scrimba
Frontend Career Path
Advanced React
Reusability
Toggle.On & Toggle.Off
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Toggle.On & Toggle.Off
Expand for more info
Toggle
ToggleOn.js
run
preview
console
/**
* Challenge:
*
* 1. Create a new component, ToggleOn, that accepts children
* in props
* 2. Receive the `on` state from context
* 3. Conditionally render `children` if `on` is true. If `on`
* is false, render `null` instead of `children`
*/
Console
"Star state toggled"
,
"Toggled"
,
/index.html
-4:39