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

Make window resize events re-render the color triangle #9

Closed masakudamatsu closed 3 years ago

masakudamatsu commented 3 years ago

Currently, changing the browser's window width makes the color triangle disappear

It seems the way I use a custom hook (useWindowWidth()) is wrong.

I'll wait until Epic React teaches me on custom hooks.

masakudamatsu commented 3 years ago

The reason was that the second useEffect hook has the second argument [canvasContext]. Removing this makes the window resizing re-render the color triangle!