更新组件
来源:8-1 ⽤useRef实现useDocumentTitle - useRef与Hook 闭包详解(上)

宁静的海8752814
2021-05-21
Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code.
- Move code with side effects to componentDidMount, and set initial state in the constructor.
Please update the following components: SideEffect(NullComponent)
按照老师的步骤操作,发现页面有这样一个警告,怎么移除componentDidMount,又怎么样更新SideEffect组件呢?
写回答
1回答
-
Nolan
2021-05-23
不应该啊..课程里用到的包没有使用到UNSAFE_componentWillMount的,是做了什么以后出现的这个错误?
022021-05-24
相似问题