reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.93k stars 15.27k forks source link

[Docs] Redux with Next.js Per-route state #4713

Open raky291 opened 4 months ago

raky291 commented 4 months ago

What docs page needs to be fixed?

What is the problem?

I'm learning Nextjs and want to setup Redux in Nextjs but this section is not very clear to me Additional Configuration > Per-route state, also the source code is not available in the documentation. It seems as if the documentation is not updated, it doesn't match with the project npx create-next-app --example with-redux my-app.

image

What should be changed to fix the problem?

Adding an example would be useful to understand why I should initialize the store again, and in what situation I should do it.

billymoon commented 3 months ago

I am having the same problem. I created a fork from nextjs repo with-redux example with minimal reproduction...

https://github.com/vercel/next.js/commit/7343c29389d189421b6c27a4d3b5617f75a3062a

And attempt to explain it here: https://github.com/billymoon/next.js/blob/canary/examples/with-redux/problem.md

I also opened a ticket on next js repo here: https://github.com/vercel/next.js/issues/68434

Very interested if anyone has any leads on how to resolve this issue.