Skip to content

Commit bea5a2b

Browse files
authored
[Fiber/DevTools] Stop injecting findHostInstanceByFiber (#30519)
This is not used by DevTools since it has its own implementation of it. This function is getting removed since `findDOMNode` is getting removed so we shouldn't keep around extra bytes unnecessarily. There is also `findHostInstancesForRefresh` which should really be implemented on the `react-refresh` side. Not using an injection but that's a heavier lift and only affects `__DEV__`.
1 parent 3043e1a commit bea5a2b

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

packages/react-reconciler/src/ReactFiberReconciler.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,6 @@ if (__DEV__) {
827827
};
828828
}
829829

830-
function findHostInstanceByFiber(fiber: Fiber): Instance | TextInstance | null {
831-
const hostFiber = findCurrentHostFiber(fiber);
832-
if (hostFiber === null) {
833-
return null;
834-
}
835-
return hostFiber.stateNode;
836-
}
837-
838830
function emptyFindFiberByHostInstance(
839831
instance: Instance | TextInstance,
840832
): Fiber | null {
@@ -863,7 +855,6 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
863855
setSuspenseHandler,
864856
scheduleUpdate,
865857
currentDispatcherRef: ReactSharedInternals,
866-
findHostInstanceByFiber,
867858
findFiberByHostInstance:
868859
findFiberByHostInstance || emptyFindFiberByHostInstance,
869860
// React Refresh

0 commit comments

Comments
 (0)