I created a redux store with the reducer and enhancer functions.
const store = createStore(rootReducer, compose(
applyMiddleware(thunk),
DevTools.instrument()
))
rootReducer uses combineReducers to create a single root reducer. I would like to initialize the window's location value within the store so I tried something like this:
const initialWindowLocation = window.location.hostname
const store = createStore(rootReducer, initialWindowLocation, compose(
applyMiddleware(thunk),
DevTools.instrument()
))
I connected the store to the redux forms and I'm able to grab all the reducer values via mapStateToProps but I'm stuck trying to access a simple string value(i.e.initialWindowLocation) from the redux createStore. Is there some redux tricks that I'm missing?
Also if I try that I'm getting an unexpected key error:
Unexpected key found in previous state received by the reducer.
Any thoughts on this? Thanks in advance.