ghulamabbas2 / bookit

bookit.vercel.app
85 stars 55 forks source link

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

Open KristijanStosic opened 2 years ago

KristijanStosic commented 2 years ago

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 commented 2 years ago

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