-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RTK Query and Next 13 app
dir / React Server components: status and discussion
#3508
Comments
General notes:
|
@markerikson I'm having issues with getting Redux state hydration working in Next 13. My strategy from Next 12 & pages router doesn't work with the app router. And the Are you aware of this already? If not -- should I open a new issues to dig into this further, or would you prefer a comment in this ticket instead? |
@EvHaus : per this thread, we generally don't have any specific support for the App Router + Redux stuff atm, beyond "if you intend to use Redux on the client side, make sure to render What are you actually trying to accomplish? |
I want the server to fetch data from a database and return it to the client along with the SSR HTML so that Redux state can be hydrated on the client without the client needing to make its own additional fetches. Very similar to what https://github.com/kirill-konshin/next-redux-wrapper is doing. |
Yeah, we have no actual answer for that with the App Router right now, largely due to the lack of API features needed to make that even possible. See Lenz's article here for some more details: @phryneas can maybe chime in more, but right now that's not feasible as far as I know. |
Note that we now have official docs on how to set up Redux with Next.js and the App Router correctly: |
Thanks for the documentation..it was really needed.
I do plan to use Redux for global data, but probably not mutable. For example, when my application loads, I plan to fetch the app settings and store the data in the redux store so I can have it readily accessible for client components usage. What's your take on this please ? |
We're getting a lot of questions about whether RTK Query works with RSCs.
Quoting Lenz at https://twitter.com/phry/status/1666553972075687938 :
We're also looking at tweaking RTKQ + React-Redux to not throw errors related to calling
createContext
in an RSC environment.The text was updated successfully, but these errors were encountered: