How to set initial state in Redux?
You need to pass initial state as second argument to createStore:
const rootReducer = combineReducers({todos: todos,visibilityFilter: visibilityFilter,});const initialState = {todos: [{ id: 123, name: 'example', completed: false }],};const store = createStore(rootReducer, initialState);
August 06, 2022
307
Read more
What is React?
November 06, 2022
ReactJSHow to programmatically trigger click event in React?
November 06, 2022
ReactJS