Switch Tutorial - In React
export function ParentFrame() {
const [state, setState] = React.useState({
mode: "day",
})
const handleSwitchFlip = () => {
setState({
mode: "night",
})
}
return (
<Frame>
<Switch
isOn={state.mode === "night"}
onValueChange={handleSwitchFlip} />
</Frame>
)
}