mobx-react

Can't call setState on a component that is not yet mounted

拈花ヽ惹草 提交于 2019-11-29 09:18:34
this is the first time I face this warning message. Can't call setState on a component that is not yet mounted. Follows: This is a no-op, but it might indicate a bug in your application. Instead, assign to this.state directly or define a state = {}; class property with the desired state in the MyComponent component. The " not yet mounted " part actually makes little to no sense as the only way to trigger the issue is to call a function by clicking a button from a component that needs to be mounted in order to see the button. The component is not unmounted at any given time neither. This dummy