I can't seem to get ref bindings correctly
I'm trying to implement spatial-navigation in my app so I want to convert this package from Reactjs to Solidjs:
https://github.com/NoriginMedia/Norigin-Spatial-Navigation/
(There are only 6 files to convert and 1/2 of them are vanilla JS code)
My current issue is that I can't seem to get the ref bindings correctly. Here is a hook exported from the app:
And here is one of my Solidjs ref implementations:
Continuation ⬇️
GitHub
GitHub - NoriginMedia/Norigin-Spatial-Navigation: React Hooks based...
React Hooks based Spatial Navigation (Key & Remote Control Navigation) / Web Browsers, Smart TVs and Connected TVs - GitHub - NoriginMedia/Norigin-Spatial-Navigation: React Hooks based Spat...
7 Replies
And here is another:
I have also tried this:
But they all return
undefined
How can I properly pass the ref into the hook (and allow for updates)?
Or is there a better or pre-made way to implement spatial naviagation in solidjs apps?try using a signal
you can either have the signal outside where the
useFocusable
hook is used or make it part of the hook and return the setter
OR
Okay. I'll try that once I get to my laptop.
Hey. I just tried this (creating the signal in the hook and returning the setter) and it worked. Thanks a lot.
Hi!
Do you have any progress with porting this library? Have the same task in front of me and I wonder if anyone already did that
Hi! I already ported it completely.
I'll push the code to a new repo when I get home.
Oh, thats great
Yupp