'when using combinereducers, wont update all of my reducer states
I have a big project that I'm trying to combine two reducers when I am calling an action from one reducer, redux overwrite my other reducer's state to initial state here is some photos from my redux devTool and my code
this is my state when the first action from first reducer is called enter image description here
and this is when my second action from second reducer gets called enter image description here
as you can see the slider array gets empty. I'm combining two reducers like this
import { combineReducers } from 'redux'
import auth from './auth'
import slider from './slider'
export default combineReducers({
slider,
auth,
})
and in my index.js file
import reducer from './store/reducers/index'
const composedEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, composedEnhancers(applyMiddleware(thunk)));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
