【React】为何useEffect传空数组也会调用两次

React的严格模式不能自动检测副作用,有意双重调用。将严格模式注释即可。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/owo_ovo/article/details/135394417