@samitouri / QOS-React / commits / bea5a2bc46

[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__`.

Sebastian Markbåge committed Jul 29, 2024 at 20:05 UTC bea5a2bc46cc95713392175c3c6307e49c14cd98
1 file changed -9
packages/react-reconciler/src/ReactFiberReconciler.js
-9
@@ -827,14 +827,6 @@ if (__DEV__) {
827 };
828 }
829
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 -
830 function emptyFindFiberByHostInstance(
831 instance: Instance | TextInstance,
832 ): Fiber | null {
@@ -863,7 +855,6 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
855 setSuspenseHandler,
856 scheduleUpdate,
857 currentDispatcherRef: ReactSharedInternals,
866 - findHostInstanceByFiber,
858 findFiberByHostInstance:
859 findFiberByHostInstance || emptyFindFiberByHostInstance,
860 // React Refresh