Persistent State using islands-router #4646
Unanswered
CodingFlow
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying out islands-router on my SSR + islands app and running into a few issues. The main issue is that context basically does not work: if there are any server components between context provider and user, it does not work (which is the main use-case). So I tried storing signals in a
OnceLock, but found that the state from the signals are not rendered when switching pages, even if there is anEffectto update a derived signal (using closure) that reads signals from theOnceLock.I need a secure enough client-side storage that persists between pages, such as in-memory, for authentication tokens and other less sensitive data. Any ideas on how to achieve this with islands-router or does the islands-router feature need more time to stabilize?
Secondary related issue: clicking links that go to the same page (hashtag <--> same page without hashtag) resets displayed signal values to default, even if signals are stored in a
OnceLock, andEffects are not re-run to allow trying to update the values.Thank you in advance for any help! 🙇
Beta Was this translation helpful? Give feedback.
All reactions