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

Update next-redux-wrapper from 6x to 7x #6

Open
KristijanStosic opened this issue Mar 3, 2022 · 1 comment
Open

Update next-redux-wrapper from 6x to 7x #6

KristijanStosic opened this issue Mar 3, 2022 · 1 comment

Comments

@KristijanStosic
Copy link

Can you update next redux wrapper to version 7x , it is a slighly different changes, but can you update it ?

This is official documentation for next-redux-wrapper libray:

Upgrade from 6.x to 7.x
Signature of createWrapper has changed: instead of createWrapper you should use createWrapper<Store>, all types will be automatically inferred from Store.

GetServerSidePropsContext and GetStaticPropsContext are no longer exported from next-redux-wrapper, you should use GetServerSideProps, GetServerSidePropsContext, GetStaticProps and GetStaticPropsContext directly from next.

All signatures like ({store, req, res, ...}) => { ... } were changed to store => ({req, res, ...}) => { ... } in order to keep Next.js internals free of modifications and for better typings support.

In version 7.x you have to manually wrap all getInitialProps with proper wrappers: wrapper.getInitialPageProps and wrapper.getInitialAppProps.

window.NEXT_REDUX_WRAPPER_STORE has been removed as it was causing issues with hot reloading

@RangerCoder99
Copy link

It's not just the next redux wrapper, the complete use of Redux need to be updated to use Redux Toolkit

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

2 participants