Page-specific values for a store in zustand
Unanswered
Hovawart posted this in #help-forum
HovawartOP
I am trying to make a profile page. I fetched the user info in a server component and saved it in a zustand slice.
The problem is that if the user navigates to a different profile page, the store would be overridden, so if the user then comes back to the first page it would break.
I found this in the zustand docs: https://docs.pmnd.rs/zustand/guides/initialize-state-with-props
but I don't understand how to do it with the slices pattern.
The problem is that if the user navigates to a different profile page, the store would be overridden, so if the user then comes back to the first page it would break.
I found this in the zustand docs: https://docs.pmnd.rs/zustand/guides/initialize-state-with-props
but I don't understand how to do it with the slices pattern.