facebookarchive / redux-react-hook

React Hook for accessing state and dispatch from a Redux store
MIT License
2.16k stars 103 forks source link

how to redux hooks update on an unmounted component #128

Open specialgirlgotoheaven opened 3 years ago

specialgirlgotoheaven commented 3 years ago

image when I use dispatch,it will error like above picture。 how to redux hooks update on an unmounted component

jaketodaro commented 3 years ago

This react error shows when an unmounted component attempts to update state, which is not allowed. Make sure that whatever code is calling dispatch does not run after the component is unmounted. Take a look at https://www.debuggr.io/react-update-unmounted-component/ for tips on debugging these issues.