mirror of
https://github.com/facebook/react.git
synced 2026-02-24 12:43:00 +00:00
Stacked on #30491. When going from DOM Node to select a component or highlight a component we find the nearest mounted ancestor. However, when multiple renderers are nested there can be multiple ancestors. The original fix #24665 did this by taking the inner renderer if it was an exact match but if it wasn't it just took the first renderer. Instead, we can track the inner most node we've found so far. Then get the ID from that node (which will be fast since it's now a perfect match). This is a better match. However, the main reason I'm doing this is because the old mechanism leaked the `Fiber` type outside the `RendererInterface` which is supposed to abstract all of that. With the new algorithm this doesn't leak. I've tested this with a new build against the repro in the old issue #24539 and it seems to work.
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.