Skip to content

Commit 15e779d

Browse files
author
Brian Vaughn
authored
Reconciler should inject its own version into DevTools hook (#21268)
1 parent 4f76a28 commit 15e779d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/react-reconciler/src/ReactFiberReconciler.new.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ import {
9595
findHostInstancesForRefresh,
9696
} from './ReactFiberHotReloading.new';
9797
import {markRenderScheduled} from './SchedulingProfiler';
98-
98+
import ReactVersion from 'shared/ReactVersion';
9999
export {registerMutableSourceForHydration} from './ReactMutableSource.new';
100100
export {createPortal} from './ReactPortal';
101101
export {
@@ -739,5 +739,8 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
739739
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
740740
// Enables DevTools to append owner stacks to error messages in DEV mode.
741741
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,
742745
});
743746
}

packages/react-reconciler/src/ReactFiberReconciler.old.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ import {
9595
findHostInstancesForRefresh,
9696
} from './ReactFiberHotReloading.old';
9797
import {markRenderScheduled} from './SchedulingProfiler';
98-
98+
import ReactVersion from 'shared/ReactVersion';
9999
export {registerMutableSourceForHydration} from './ReactMutableSource.old';
100100
export {createPortal} from './ReactPortal';
101101
export {
@@ -739,5 +739,8 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
739739
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
740740
// Enables DevTools to append owner stacks to error messages in DEV mode.
741741
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,
742745
});
743746
}

0 commit comments

Comments
 (0)