Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created May 4, 2020 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladchinda/a74aeabd1e16bbad7982b52425201755 to your computer and use it in GitHub Desktop.
Save gladchinda/a74aeabd1e16bbad7982b52425201755 to your computer and use it in GitHub Desktop.
import React from 'react';
import useTheme from './useTheme';
import ThemeContext from './theme';
export default function App() {
const { theme, darkMode, inheritSystem } = useTheme();
return <>
{/* Render the color scheme controls widget here */}
{/* Use `theme`, `darkMode` and `inheritSystem` as required */}
<ThemeContext.Provider value={theme}>
{/* Render rest of app (consume the theme context) */}
</ThemeContext.Provider>
</>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment