What should be done with the warning from the console, reactjs?

Warning: setState (.): Can only update a mounted or mounting component. This usually means you called setState () on an unmounted component. This is a no-op. Please check the code for the GroupManag component.

Mar.20,2021
Before the

component is rendered, it can be assigned directly through this.state = {}.


the method upstairs doesn't quite agree. The reason for this problem is that your component is uninstalled, but setState is executed. The correct way to do this is when uninstalling the component: this.setState (() = > {})

Menu