Skip to content

Instantly share code, notes, and snippets.

Last active Jan 29, 2020
What would you like to do?
App using useGlobalState
export default function App() {
const [theme, dispatch] = useGlobalState(appState, state => state.theme);
return (
<div style={{ background: theme.background }}>
<button onClick={() => dispatch('toggleTheme')}>Toggle theme</button>
<p style={{ color: theme.text }}>
You're enjoying the {} theme
Copy link

DominicTobias commented Jan 29, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment