Page 1 of 1

Cannot update a component from inside the function body of a different component.

Posted: Fri Jul 17, 2020 11:10 pm
by Administrator
If your getting this error, Cannot update a component from inside the function body of a different component. in your javascript console then a state update is being triggered by another component. I had this problem and my solution was to move some code from the constructor to the componentDidMount. This degraded my performance slightly, but now works I have a translation system that pulls from an api, but when i was getting the action from redux it triggered an update from the constructor of another component. Thus updating a component that is about to unmount.