Releases: kirill-konshin/next-redux-wrapper
7.0.0
Add support for Redux Toolkit and some type enhancements
Fixed hot reload
Migration guide: https://github.com/kirill-konshin/next-redux-wrapper#upgrade-from-6x-to-7x
7.0.0-rc.2
Fixed hot reload
7.0.0-rc.1
Add support for Redux Toolkit and some type enhancements
6.0.2
Fix async in getServerSideProps
6.0.1
Fixed issue with opting out of automatic static optimization despite not using getInitialProps
in _app
6.0.0
Support for getStaticProps
and getServerSideProps
.
Major change in the way how things are wrapped in version 6.
-
Default export
withRedux
is marked deprecated, you should create a wrapperconst wrapper = createWrapper(makeStore, {debug: true})
and then usewrapper.withRedux(Page)
. -
Your
makeStore
function no longer getsinitialState
, it only receives the context:makeStore(context: Context)
. Context could beNextPageContext
orAppContext
orgetStaticProps
orgetServerSideProps
context depending on which lifecycle function you will wrap. Instead, you need to handle theHYDRATE
action in the reducer. Thepayload
of this action will contain thestate
at the moment of static generation or server side rendering, so your reducer must merge it with existing client state properly. -
App
should no longer wrap its children withProvider
, it is now done internally. -
isServer
is not passed incontext
/props
, use your own function or simple checkconst isServer = typeof window === 'undefined'
or!!context.req
or!!context.ctx.req
. -
store
is not passed to wrapped component props. -
WrappedAppProps
was renamed toWrapperProps
.
5.0.0
- Added better TypeScript integration
Breaking changes
Old-style overrides were replaced with regular Next.js interfaces:
NextJSContext
->NextPageContext
NextJSAppContext
->AppContext
you can import them as usual:
import {NextPageContext, AppContext} from 'next';
4.0.1
4.0.0 Next.js 9
- Next.js 9 types support
- Optimized passing store on client side
- Yarn
3.0.0
- Typescript
- ESLint
- Breaking: setPromise not exported
- Breaking: Store is no longer preserved between getInitialProps and render of WrappedApp. It will be always created twice, once with empty state and once with state received from getInitialProps