facebook / react · Issue No. 37604
getComponentByHostInstance reports that a React-managed metadata element is not managed by React. The same element is present and inspectable by UID in getComponentTree, so DOM-based and UID-based inspection disagree.
Current react/react main: 019019be403c3269e15b8d7ebefb57d30f84086b (React source version 19.3.0). The source includes react-devtools-cdt-mcp 0.1.0; this report is verified against the source baseline.
// Install the facade before initializing React (as documented).
const facade = installFacade();
const tools = createTools(facade);
act(() => root.render(<meta name="facade-test" content="value" />));
const element = document.head.querySelector('meta[name="facade-test"]');
console.log(tools.getComponentByHostInstance(element));
// {error: 'Host instance is not managed by React'}
A runnable repository regression test is included in the linked fix PR.
Lookup fails for title/meta and non-resource link instances. Resource-backed style elements follow a different storage path and can be found.
A React-managed hoistable DOM element should resolve to its host component, with the same UID and props returned by component-tree inspection.
getHostInstanceForFiber handles HostHoistable only through memoizedState.instance. Non-resource hoistables have null memoizedState and store their DOM instance in stateNode (see the HostHoistable commit path).
Source: packages/react-devtools-facade/src/DevToolsFacadeTreeTools.js.
Severity assessment: Medium. getComponentByHostInstance reports that a React-managed metadata element is not managed by React. The same element is present and inspectable by UID in getComponentTree, so DOM-based and UID-based inspection disagree.
Before: the non-resource hoistable regression fails and the resource-backed control passes through the official DevTools build test entry. After: DevToolsFacade and DevToolsCdtMcp pass 132/132 tests. Prettier, ESLint and Flow pass.
Searched all Issue/PR states for getHostInstanceForFiber, facade meta and hoistable DevTools. #36820 introduced this lookup; #30584/#30590 and #35741 concern the separate full DevTools renderer backend and its node mapping/lifecycle. No equivalent facade fallback was found.
The resource-record lookup keeps its existing priority. The fallback matches the reconciler stateNode storage for non-resource hoistables. This changes inspection only, not rendering or resource lifetime.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.