This is a bug, I think no explanation is needed, just take a look at the screenshot and how is state.tracker.projects is set in console and in redux devtools: http://prntscr.com/bqc1yi
Reducer code:
export default function tracker(state = initialState, action) {
switch (action.type) {
case SET_PROJECTS:
return Object.assign({}, state, { projects: action.projects });
default:
return state;
}
}
I am using "redux": "^3.5.2" inside electron-react-boilerplate (https://github.com/chentsulin/electron-react-boilerplate)
I don't think this is a bug in Redux, if anything it seems like the log monitor is not correctly reporting the state. If you call store.getState() does it have the correct state?
no, it has same values as in redux dev tools
I'm really not clear on what the actual issue is here. This certainly doesn't look like a problem with Redux itself, and I'm not seeing anything actionable. Whatever's going on is likely due to your reducer logic and your middleware configuration. I'm going to go ahead and close this. If you come up with information that shows this is an actual bug with Redux, I'll reopen it.
I already added the reducer, the redux setup code (with middlewares):
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger';
import { hashHistory } from 'react-router';
import { routerMiddleware, push } from 'react-router-redux';
import rootReducer from '../reducers';
import { SET_LOCATION } from '../actions/app';
const logger = createLogger({
level: 'info',
collapsed: true,
});
var setLocationMiddleware = store => next => action => {
if (action.type !== SET_LOCATION) {
return next(action);
}
store.dispatch(push(action.location));
}
const router = routerMiddleware(hashHistory);
const enhancer = compose(
applyMiddleware(thunk, router, logger, setLocationMiddleware),
window.devToolsExtension ? window.devToolsExtension() : noop => noop
);
export default function configureStore(initialState) {
const store = createStore(rootReducer, initialState, enhancer);
if (module.hot) {
module.hot.accept('../reducers', () =>
store.replaceReducer(require('../reducers')) // eslint-disable-line global-require
);
}
return store;
}
the actual bug in redux: in console and debugger state.tracker.projects is array but in redux devtools it is null
the actual bug in redux: in console and debugger state.tracker.projects is array but in redux devtools it is null
Right, that doesn't sound like a bug in Redux. Redux devtools is a separate project. If store.getState() is returning the correct value then it is not a bug in Redux core.
please read carefully: http://prntscr.com/bqeuly
It would help if you could provide a sample project demonstrating this issue.
@cutbko Your first screenshot --> http://prntscr.com/bqc1yi , clearly shows that redux-logger is outputting the state i.e state.tracker.projects = [array] correctly, which mimics what store.getState() would return. Are you sure store.getState() is returning state.tracker.projects = null?