Reconciler should inject its own version into DevTools hook (#21268)
Brian Vaughn committed
Apr 14, 2021 at 14:47 UTC
15e779d921e11f22a39e688a5de89c3777462114
2 files changed
+8
-2
packages/react-reconciler/src/ReactFiberReconciler.new.js
+4
-1
@@ -95,7 +95,7 @@ import {
95
findHostInstancesForRefresh,
96
} from './ReactFiberHotReloading.new';
97
import {markRenderScheduled} from './SchedulingProfiler';
98
-
98
+import ReactVersion from 'shared/ReactVersion';
99
export {registerMutableSourceForHydration} from './ReactMutableSource.new';
100
export {createPortal} from './ReactPortal';
101
export {
@@ -739,5 +739,8 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
739
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
740
// Enables DevTools to append owner stacks to error messages in DEV mode.
741
getCurrentFiber: __DEV__ ? getCurrentFiberForDevTools : null,
742
+ // Enables DevTools to detect reconciler version rather than renderer version
743
+ // which may not match for third party renderers.
744
+ reconcilerVersion: ReactVersion,
745
});
746
}
packages/react-reconciler/src/ReactFiberReconciler.old.js
+4
-1
@@ -95,7 +95,7 @@ import {
95
findHostInstancesForRefresh,
96
} from './ReactFiberHotReloading.old';
97
import {markRenderScheduled} from './SchedulingProfiler';
98
-
98
+import ReactVersion from 'shared/ReactVersion';
99
export {registerMutableSourceForHydration} from './ReactMutableSource.old';
100
export {createPortal} from './ReactPortal';
101
export {
@@ -739,5 +739,8 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
739
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
740
// Enables DevTools to append owner stacks to error messages in DEV mode.
741
getCurrentFiber: __DEV__ ? getCurrentFiberForDevTools : null,
742
+ // Enables DevTools to detect reconciler version rather than renderer version
743
+ // which may not match for third party renderers.
744
+ reconcilerVersion: ReactVersion,
745
});
746
}