CJY0208 / react-activation

Hack <KeepAlive /> for React
https://www.npmjs.com/package/react-activation
MIT License
1.78k stars 140 forks source link

Can't call setState on a component that is not yet mounted. 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 ProviderBridge2 component. #304

Open qinzhiwei1993 opened 7 months ago

qinzhiwei1993 commented 7 months ago

Can't call setState on a component that is not yet mounted. 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 ProviderBridge2 component.

切换tab标签的时候,大家遇到过这个问题吗?

CJY0208 commented 7 months ago

可以提供一个最简示例吗?

duwenbin0316 commented 6 months ago

可以提供一个最简示例吗?

我也遇到了相同的问题,demo:https://codesandbox.io/p/live/483dfbcc-4ec7-465b-ac1d-dd5399ae124d