-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist doesn't work as expected #64
Comments
I'm having issues getting it to work as well. |
@NorouziM Can you try adding a logging middleware to understand if the store is rehydrated? I added an example below. This helped me eliminate zustood/zustand as a root cause.
Add it to Zustood options:
|
|
On my first attempt the store was reinitialized too, but I notice it was a useEffect with the initial data. Removing the useEffect now it works fine. |
I'm having the same issue and couldn't figure out a way to make it work. store.js
app.js
My access token is always null when app is relaunch or reload via dev tool. How an I make the data persist? It used to work when using zustood "@udecode/zustood": "^1.1.3". Yes, I'm using react-navigation in my app. Can any show me a working setup? thanks. |
My app crashes when trying to use the persist middleware. Here's the error I get and the implementation I have: This issue has been open for a while without any attention from the maintainer. @zbeyens, can we please get some support with this? |
@zbeyens are you accepting contributions for this? no working rehydration means we can't use this lib. |
Sure, I'd merge it asap |
@elijaholmos can you use the latest version and let me know if the issue still persist? |
Description
Hello, I've enabled the "persist" option, which stores data in local storage. However, when I refresh the page, the data is replaced with the initial state, effectively removing the stored data. The documentation lacks a clear example of how this feature should work. Simply setting the data to local storage without retrieving it during hydration (page reload) doesn't achieve the intended purpose of persisting.
My code:
The text was updated successfully, but these errors were encountered: