Closed masakudamatsu closed 3 years ago
Currently, changing the browser's window width makes the color triangle disappear
canvas
It seems the way I use a custom hook (useWindowWidth()) is wrong.
useWindowWidth()
I'll wait until Epic React teaches me on custom hooks.
The reason was that the second useEffect hook has the second argument [canvasContext]. Removing this makes the window resizing re-render the color triangle!
useEffect
[canvasContext]
Currently, changing the browser's window width makes the color triangle disappear
canvas
element does shrink or expand, though.It seems the way I use a custom hook (
useWindowWidth()
) is wrong.I'll wait until Epic React teaches me on custom hooks.