老师,我写的时候报了个错
来源:8-6 【订阅state】store的连接与订阅

小奶猫不想来吃瓜
2023-09-11
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 HeaderComponent component.
写回答
1回答
-
阿莱克斯刘
2024-03-26
应该在构造方法中声明(初始化)一下state。不好意思,没看到这个问题,这么久才回答
00
相似问题