Files
react/packages/react-devtools-shared
Sebastian Markbåge d76a5651f4 [DevTools] Handle reordered contexts in Profiler (#30887)
While looking at the Context tracking implementation for other reasons I
noticed this bug.

Originally it wasn't allowed to have conditional `useContext(context)`
(although we did because it's technically possible). With `use(context)`
it is officially allowed to be conditional as long as it is within a
Hook/Component and not within a try/catch.

This means that this loop comparing previous and next contexts need to
consider that the Context objects might not line up and so it's possibly
comparing apples to oranges. We already bailed if one was longer than
the other.

If the order of contexts changes later in the component that means
something else must have already changed earlier so the reason for the
rerender isn't the context so we can just return false in that case.
2024-09-06 21:45:52 -04:00
..
2022-03-16 11:37:10 -04:00

This directory contains code shared between several DevTools packages:

  • /packages/react-devtools-core
  • /packages/react-devtools-extensions
  • /packages/react-devtools-inline

It is not published or released anywhere directly.