Skip to content

Instantly share code, notes, and snippets.

@zprima
Created May 5, 2019 13:50
Show Gist options
  • Save zprima/3dc5ead29791846fa4b76c08d84d23bb to your computer and use it in GitHub Desktop.
Save zprima/3dc5ead29791846fa4b76c08d84d23bb to your computer and use it in GitHub Desktop.
medium_p7_c3
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