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

Post Reply
User avatar
Administrator
Site Admin
Posts: 1747
Joined: Thu Mar 22, 2018 10:19 am

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

Post by Administrator » Fri Jul 17, 2020 11:10 pm

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.

Post Reply