hapi-universal-redux icon indicating copy to clipboard operation
hapi-universal-redux copied to clipboard

nextRootReducer is undefined

Open kevzettler opened this issue 9 years ago • 3 comments

What is nextRootReducer supposed to be here?

https://github.com/luandro/hapi-universal-redux/blob/master/src/store.js#L17

kevzettler avatar May 27 '16 21:05 kevzettler

You're getting undefined?

Here's where I got that from:

https://stackoverflow.com/questions/34243684/make-redux-reducers-and-other-non-components-hot-loadable

luandro avatar May 31 '16 14:05 luandro

luandro, I just saw this issue when I was converting hapi-universal-redux to use TypeScript... are you sure you've named the variable correctly here:

        const {reducer: nextReducer} = require('./reducers/index');
        store.replaceReducer(nextRootReducer);

TypeScript flagged nextRootReducer - when I looked at your stackoverflow reference the code shown was: const nextRootReducer = require('./reducers/index').default;

So it looks to me as if you've named it wrong? This is why I like TypeScript- it catches this type of thing while you're editing. :-)

ttlnow avatar Jul 28 '16 03:07 ttlnow

Updated according to the answer in Stackoverflow, but the functionality didn't change at all... Is there a bug somewhere?

luandro avatar Jul 28 '16 12:07 luandro