Zustand state updates across pages in Next.js App Router #2720
-
I'm using Zustand with Next.js App Router and encountering an issue where state updates in one page are not reflected in other pages that use the same store. Specifically, updating the I've implemented the store following the documentation for Next.js integration I'm using this store in multiple client components, each marked with accumulation-phase.tsx growth-phase.tsx When App - https://wealthbuildr.vercel.app/accumulation-phase Is this behavior expected when using Zustand with Next.js App Router? I've reviewed the Zustand documentation for Next.js integration, but I'm unsure if there are additional steps needed for the App Router specifically. Any insights or guidance would be greatly appreciated. Thank you for your time and assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@devevignesh everything looks good to me, I don't see the behavior that you are talking about |
Beta Was this translation helpful? Give feedback.
-
Hey @dbritto-dev, thanks for looking into this. When navigating to the Growth tab, which is a separate route, and toggling the inflation switch, the "Accumulation Phase" value is not updating. I have subscribed to the inflationToggle state to trigger a re-render of the page when it changes, but it's not working as expected. Could you please check the attached file? Wealthbuildr-Your-Journey-to-Financial-Abundance.webm |
Beta Was this translation helpful? Give feedback.
@devevignesh the
inflationToggle
is working as expected as far as I can see. The issue would be thecomputedData