import React from 'react' import ReactDOM from 'react-dom' import { Mode, useLightSwitch, useModeSelector } from '../' const Simple: React.FC = () => { const mode = useLightSwitch() let color = 'green' let name = 'Light' if (mode === Mode.Dark) { color = 'red' name = 'Dark' } return

Simple

{name}
} const WithSelector: React.FC = () => { const selected = useModeSelector({ light: { color: 'green', name: 'Light' }, dark: { color: 'red', name: 'Dark' }, unset: { color: 'blue', name: 'Unset' }, }) return

Selector

{selected.name}
} const App: React.FC = () => { return
} ReactDOM.render(, window.document.getElementById('root'))