Skip to content

Commit 6071486

Browse files
authored
Remove ReactComponentTreeHook from internals (#19032)
We don't really support mixing minor versions anymore anyway. But seems safe to remove in 17.
1 parent 43e59f2 commit 6071486

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

packages/react/src/ReactSharedInternals.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ const ReactSharedInternals = {
2222
};
2323

2424
if (__DEV__) {
25-
Object.assign(ReactSharedInternals, {
26-
// These should not be included in production.
27-
ReactDebugCurrentFrame,
28-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
29-
// TODO: remove in React 17.0.
30-
ReactComponentTreeHook: {},
31-
});
25+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
3226
}
3327

3428
export default ReactSharedInternals;

packages/react/src/forks/ReactSharedInternals.umd.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,18 @@ const ReactSharedInternals = {
2121
ReactCurrentBatchConfig,
2222
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
2323
assign,
24+
25+
// Re-export the schedule API(s) for UMD bundles.
26+
// This avoids introducing a dependency on a new UMD global in a minor update,
27+
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
28+
// This re-export is only required for UMD bundles;
29+
// CJS bundles use the shared NPM package.
30+
Scheduler,
31+
SchedulerTracing,
2432
};
2533

2634
if (__DEV__) {
27-
Object.assign(ReactSharedInternals, {
28-
// These should not be included in production.
29-
ReactDebugCurrentFrame,
30-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
31-
// TODO: remove in React 17.0.
32-
ReactComponentTreeHook: {},
33-
});
35+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
3436
}
3537

36-
// Re-export the schedule API(s) for UMD bundles.
37-
// This avoids introducing a dependency on a new UMD global in a minor update,
38-
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
39-
// This re-export is only required for UMD bundles;
40-
// CJS bundles use the shared NPM package.
41-
Object.assign(ReactSharedInternals, {
42-
Scheduler,
43-
SchedulerTracing,
44-
});
45-
4638
export default ReactSharedInternals;

0 commit comments

Comments
 (0)