Norigin-Spatial-Navigation icon indicating copy to clipboard operation
Norigin-Spatial-Navigation copied to clipboard

FocusSelf causes everything to be focused

Open willbarkoff opened this issue 2 years ago • 1 comments

This PR fixes bugs when using React 18+ by ensuring that a useEffect call in useFocusable only happens on mount (#8).

willbarkoff avatar Jul 05 '22 13:07 willbarkoff

We're running into this issue as well with react 18, it'd be awesome to have it fixed. Thanks for looking into it @willbarkoff!

nsillik avatar Aug 02 '22 20:08 nsillik

Hello! I have made similar changes and it's already available in the v1.1.0: https://github.com/NoriginMedia/Norigin-Spatial-Navigation/releases/tag/v1.1.0 I have used a bit different useEffectOnce hook that also accounts for the unmount cleanup effects: https://blog.ag-grid.com/avoiding-react-18-double-mount/

asgvard avatar Sep 08 '22 10:09 asgvard

Thanks for the contribution anyways! I have also applied the TS fixes, somehow it got missed during the "build" command and got published like this. ESLint didn't detect them either 🤷

asgvard avatar Sep 08 '22 10:09 asgvard