easy10 min
Build a Toggle
Build a toggle switch component that alternates between ON and OFF states. The toggle should visually indicate its current state and change when clicked. Practice boolean state management and conditional rendering.
Skills
useStateconditional rendering
Tests
- Renders with initial state OFF
- Toggles to ON when clicked
- Toggles back to OFF when clicked again
- Button label reflects the current state
Loading editor...