Open bartlangelaan opened 3 weeks ago
@bartlangelaan is attempting to deploy a commit to the 47ng Team on Vercel.
A member of the Team first needs to authorize it.
Thanks, wow this is so much cleaner!
I had heard of useSyncExternalStore, but it didn't occur to me to use it here, it sounds like a perfect use-case. Great job!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
nuqs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 30, 2024 10:57pm |
I don't have time to test it today, so if you can't wait and want to test it, feel free! :-)
Regarding the emitter, it's use is to make sure the searchParams
returned by the adapter hook is reactive: when the URL changes, no matter the reason (internal query state change, Link, back/fwd navigation), every hook needs to get the new value.
Hey, do you have some bandwidth to work on this again, or do you mind if I pick it up?
I don't mind at all! I don't know when I will have time for this, so feel free!
This utilizes the
useSyncExternalStore
hook in the React adapter, which automatically takes care of rehydration errors.I'm unsure if it still works correctly, because this version does not use the emitter value anymore. It just gets it from the location every time. I will test it before marking it as ready.