Skip to content
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

Usage with Next.js 13? #494

Closed
Jdyn opened this issue Oct 26, 2022 · 8 comments
Closed

Usage with Next.js 13? #494

Jdyn opened this issue Oct 26, 2022 · 8 comments

Comments

@Jdyn
Copy link

Jdyn commented Oct 26, 2022

Is your feature request related to a problem? Please describe.
Are there plans to include a migration guide to setup with Next.js 13 app directory? It looks like Next.js introduced changes that eliminate _document and _app when using the new file structure.

Describe the solution you'd like
A migration guide to get it working with Next.js 13

@aarondewindt
Copy link

@kirill-konshin
Are there currently any plans or maybe workaround we could use?

@afzaalb
Copy link

afzaalb commented Dec 18, 2022

Any update on this ?

@kirill-konshin
Copy link
Owner

This library will not work with new app structure. In fact, app structure makes redux usage really awkward and I do not recommend to do it. Since any server component can dispatch actions on server side, we will have to constantly sync redux state from server to client, which I find awkward.

My recommendation would be to clearly separate server state from client state and only update server state on server and redux (client) state on client. You will save yourself a lot of hours on not doing debugging of mixed state ;)

@DominicGBauer
Copy link

@kirill-konshin does this mean that this package will most likely become obsolete going forward since this is the direction Next is going in?

@ethyaan
Copy link

ethyaan commented Jan 24, 2023

It think it would be better to mention this in readme file that this package will doesn't fit with app Directory, this would also save people a lots of hours.

@kirill-konshin
Copy link
Owner

So far there is no clear way to use Redux with Server Components...

First of all, components that use Redux needs a Provider up in the tree in order to work, and Provider is using Context, which is not available on server (yet?).

With that said, I suggest to keep Redux as client component ("use client"), and keep server-side state outside of Redux.

@Hadi-bakhshi
Copy link

This library will not work with new app structure. In fact, app structure makes redux usage really awkward and I do not recommend to do it. Since any server component can dispatch actions on server side, we will have to constantly sync redux state from server to client, which I find awkward.

My recommendation would be to clearly separate server state from client state and only update server state on server and redux (client) state on client. You will save yourself a lot of hours on not doing debugging of mixed state ;)

why redux usage is awkward?

@Manzar473
Copy link

Manzar473 commented Nov 6, 2023

Any update on this issue? How to use this package with Next js v13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants