6

I've recently upgraded to fiber. In 15, when a component updates, the update stack trace looks like this

component1Update
...react framework stuff
  component2Update
  ...react framework stuff
    component3Update
    setState
    onClick() <-- Aha!

How do you find the origin of update in Fiber (React 16)?

user2167582
  • 5,986
  • 13
  • 64
  • 121

1 Answers1

4

I would recommend looking up the node that is being constantly updated in react-profiler, and then decorate that component with https://github.com/welldone-software/why-did-you-render this should tell you why did it update.

Lukáš Gibo Vaic
  • 3,960
  • 1
  • 18
  • 30