State and eventsPath 3/33
State & eventsConditional rendering
Your workspace must pass its server-side browser checks to complete this challenge.
Preference Toggle Switch
Create a reusable on/off control using a real button and React state.
Requirements
- Initialize the preference to off.
- Toggle it on every click without mutating state.
- Apply the
enabled class only when active.