Created
May 5, 2019 13:50
-
-
Save zprima/3dc5ead29791846fa4b76c08d84d23bb to your computer and use it in GitHub Desktop.
medium_p7_c3
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 "./App.css"; | |
import ColorPicker from "./ColorPicker"; | |
import PaintGrid from "./PaintGrid"; | |
import ColorPreview from "./ColorPreview"; | |
import { colors, PainterContext } from "../contexts/PainterContext"; | |
function App() { | |
// use state for color and setColor | |
const [color, setColor] = React.useState(colors[0]); | |
return ( | |
<div className="App container"> | |
<PainterContext.Provider value={{colors, color, setColor}}> | |
<ColorPicker /> | |
<ColorPreview /> | |
<br /> | |
<PaintGrid /> | |
</PainterContext.Provider> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment