Last active
December 20, 2020 20:20
-
-
Save zHaytam/8e7a2cb55babe9f81b6df972d5d707f1 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 MyButton from './MyButton'; | |
import ThemeContext from './ThemeContext'; | |
import React, { useState } from 'react'; | |
import ThemeToggler from './ThemeToggler'; | |
function App() { | |
const [theme, setTheme] = useState('light'); | |
const value = { theme, setTheme }; | |
return ( | |
<ThemeContext.Provider value={value}> | |
<div> | |
<MyButton text="Click me!"></MyButton> | |
<br></br> | |
<ThemeToggler></ThemeToggler> | |
</div> | |
</ThemeContext.Provider> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment