masakudamatsu / color-picker-nova

Pick a color by the contrast ratio to pure black and how much grey is mixed with pure hue
MIT License
0 stars 0 forks source link

Refactor the prop drilling with useContext #2

Open masakudamatsu opened 3 years ago

masakudamatsu commented 3 years ago

Currently we pass the handleHover and handleUnhover props all the way down from index.js to Color component.

The technique of specifying child components as props in index.js does not work, as child components are rendered in a loop: I have no idea how to assign the key props etc. to each child component if the latter is passed as a prop.