luandro / hapi-universal-redux

DEPRECATED: Create an universal React and Redux app in less than 5 minutes!
https://hapi-universal-redux.herokuapp.com/
BSD 3-Clause "New" or "Revised" License
214 stars 24 forks source link

nextRootReducer is undefined #100

Open kevzettler opened 8 years ago

kevzettler commented 8 years ago

What is nextRootReducer supposed to be here?

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

luandro commented 8 years ago

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

ttlnow commented 8 years ago

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. :-)

luandro commented 8 years ago

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