Package Exports
- next-redux
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (next-redux) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
next-redux
Next.js Redux coupling
Installation
npm add redux react-redux next-reduxSynopsis
appWithRedux(reducer, [enhancer])Usage
In the pages/_app.js file of your Next.js project:
import { combineReducers, applyMiddleware } from 'redux'
import { appWithRedux } from 'next-redux'
const reducer = combineReducers(/* Your reducers here */)
export default appWithRedux(reducer)File: pages/_app.js
With redux-devtools and redux-thunk
import { combineReducers, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunkMiddleware from 'redux-thunk'
import { appWithRedux } from 'next-redux'
const reducer = combineReducers(/* Your reducers here */)
const enhancer = composeWithDevTools(applyMiddleware(thunkMiddleware))
export default appWithRedux(reducer, enhancer)File: pages/_app.js
License
MIT