redux-undo: Get Cannot read property 'length' of undefined
i try to implement redux-undo to my app so my reducers is like
const combine = combineReducers({ designer, activities:undoable(activities), activitySelectedIndex, activitySelectedId, activityTypes, componentSelectedIndex, router: routerReducer })
and also :
function mapDispachToProps(dispatch){ return bindActionCreators(Object.assign({},actionCreators,UndoActionCreators), dispatch); }
but i get this error :
Uncaught TypeError: Cannot read property 'length' of undefined at lengthWithoutFuture (reducer.js:25) at insert (reducer.js:33) at reducer.js:307 at combination (combineReducers.js:132) at dispatch (createStore.js:179) at createStore (createStore.js:253) at applyMiddleware.js:38 at createStore (createStore.js:65) at Object.<anonymous> (Routes.js:27) at __webpack_require__ (bootstrap df649ed…:555)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 20 (3 by maintainers)
For anyone in the future who face with this problem with SSR and hydration, here is a little workaround, which mimics
undoablefor the server bundle:@joelzimmer released
beta9-9-7with thenewHistoryfunction, let me know if that solves your issue@hamdiwanis just so i’m clear - that’d be the
defaultresponse in thereducerbeing wrapped? Just want to make sure I have full context on what you are saying.