scrimba
Frontend Career Path
Advanced React
Reusability
Toggle - Planning
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 - Planning
Expand for more info
Toggle.js
run
preview
console
import React from "react"

export default function Toggle({ children }) {
const [on, setOn] = React.useState(false)

function toggle() {
setOn(prevOn => !prevOn)
}

return children
}
Console
/index.html
-2:28