Here is my reducer:
export default (state = intial_state ,actions) => {
switch(actions.type) {
case USER_INPUT_CHANGED : return {
...state,reddit_user:actions.payload
}
break;
case USER_INPUT_SUBMITTED :
return {...state,users: [...state.users, actions.payload],duplicateItem:false};
break;
default:
return state;
}
}
I have two windows. A mainwindow and another one createUserForm.js To handle multiple windows I'm using react-router-dom.
When I submit the a new user in the form window the the state update is reflected in THAT window but not the main window. Is there a way to fix this?