Last active
May 4, 2020 18:39
-
-
Save gladchinda/9b366c9ab681ceec81bf93af42cfd5f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import useColorScheme from './useColorScheme'; | |
import ThemeContext, { DARK_THEME, LIGHT_THEME } from './theme'; | |
export default function App () { | |
const dark = useColorScheme('dark'); | |
const theme = dark ? DARK_THEME : LIGHT_THEME; | |
return <> | |
<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