You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
I have two components that are nested Issues -> IssueCard. They each have their own customer reducers defined. When I unmount them - I get this error on the IssueCard path for the custom reducer.
The problem seems to be in action-reducer.js line ~144
var newState = func(mut.getIn(path), action);
if (newState === undefined) {
throw new Error('Your custom UI reducer at path ' + path.join('.') + ' must return some state');
}
The parent Issues gets unmounted this seems to wipe out the UI state for the child. Then it runs a second UI_UMOUNT_UI_STATE - it tries to run the custom reducer on a IssueCard (The state is undefined) and it returns undefined so the error trips.
This seems corrected by confirming that the existing state isn't already undefined before complaining:
if (newState === undefined && mut.getIn(path) !== undefined) {
throw new Error('Your custom UI reducer at path ' + path.join('.') + ' must return some state');
}
The text was updated successfully, but these errors were encountered:
I'm having the same problem. But in my case the nested component doesn't get unmounted. It only runs one @@redux-ui/UPDATE_UI_STATE action setting one value and then the console prints the error message.
As long as I can trust the redux dev tools in this case.
I have two components that are nested Issues -> IssueCard. They each have their own customer reducers defined. When I unmount them - I get this error on the IssueCard path for the custom reducer.
The problem seems to be in action-reducer.js line ~144
var newState = func(mut.getIn(path), action);
if (newState === undefined) {
throw new Error('Your custom UI reducer at path ' + path.join('.') + ' must return some state');
}
The parent Issues gets unmounted this seems to wipe out the UI state for the child. Then it runs a second UI_UMOUNT_UI_STATE - it tries to run the custom reducer on a IssueCard (The state is undefined) and it returns undefined so the error trips.
This seems corrected by confirming that the existing state isn't already undefined before complaining:
if (newState === undefined && mut.getIn(path) !== undefined) {
throw new Error('Your custom UI reducer at path ' + path.join('.') + ' must return some state');
}
The text was updated successfully, but these errors were encountered: