Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions packages/react/src/ReactSharedInternals.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ const ReactSharedInternals = {
};

if (__DEV__) {
Object.assign(ReactSharedInternals, {
// These should not be included in production.
ReactDebugCurrentFrame,
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
// TODO: remove in React 17.0.
ReactComponentTreeHook: {},
});
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

export default ReactSharedInternals;
26 changes: 9 additions & 17 deletions packages/react/src/forks/ReactSharedInternals.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,18 @@ const ReactSharedInternals = {
ReactCurrentBatchConfig,
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
assign,

// Re-export the schedule API(s) for UMD bundles.
// This avoids introducing a dependency on a new UMD global in a minor update,
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
// This re-export is only required for UMD bundles;
// CJS bundles use the shared NPM package.
Scheduler,
SchedulerTracing,
};

if (__DEV__) {
Object.assign(ReactSharedInternals, {
// These should not be included in production.
ReactDebugCurrentFrame,
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
// TODO: remove in React 17.0.
ReactComponentTreeHook: {},
});
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

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

export default ReactSharedInternals;