我最近升级到光纤。15、当一个组件更新时,更新堆栈跟踪如下所示
component1Update
...react framework stuff
component2Update
...react framework stuff
component3Update
setState
onClick() <-- Aha!
Run Code Online (Sandbox Code Playgroud)
你如何在 Fiber (React 16) 中找到更新的起源?
我建议查找在react-profiler中不断更新的节点,然后用https://github.com/welldone-software/why-did-you-render装饰该组件,这应该告诉你为什么它更新。
| 归档时间: |
|
| 查看次数: |
182 次 |
| 最近记录: |