cyu72 / 8bitGames

0 stars 0 forks source link

Changing state within onKeyDown function [DinoGame] #2

Closed cyu72 closed 1 year ago

cyu72 commented 1 year ago

It doesn't work properly, state does not change.

cyu72 commented 1 year ago

fixed with useRef, allowing for new value to be taken from the current value