Norigin-Spatial-Navigation
Norigin-Spatial-Navigation copied to clipboard
FocusSelf causes everything to be focused
This PR fixes bugs when using React 18+ by ensuring that a useEffect
call in useFocusable
only happens on mount (#8).
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!
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/
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 🤷