Skip to content

Commit

Permalink
Don't support older isomorphic React with newer renderers (facebook#1…
Browse files Browse the repository at this point in the history
…8329)

* Don't support older isomorphic React with newer renderers

* Remove the lazy hack
  • Loading branch information
gaearon authored Mar 17, 2020
1 parent 3a0076e commit 2666642
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/react-art/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scheduler": "^0.19.0"
},
"peerDependencies": {
"react": "^16.0.0"
"react": "^16.13.0"
},
"files": [
"LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scheduler": "^0.19.0"
},
"peerDependencies": {
"react": "^16.0.0"
"react": "^16.13.0"
},
"files": [
"LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-noop-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-server": "*"
},
"peerDependencies": {
"react": "^16.0.0"
"react": "^16.13.0"
},
"files": [
"LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"node": ">=0.10.0"
},
"peerDependencies": {
"react": "^16.0.0"
"react": "^16.13.0"
},
"dependencies": {
"loose-envify": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-test-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"scheduler": "^0.19.0"
},
"peerDependencies": {
"react": "^16.0.0"
"react": "^16.13.0"
},
"files": [
"LICENSE",
Expand Down
6 changes: 1 addition & 5 deletions packages/shared/ReactLazyComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ export function initializeLazyComponentType(
lazyComponent: LazyComponent<any>,
): void {
if (lazyComponent._status === Uninitialized) {
let ctor = lazyComponent._result;
if (!ctor) {
// TODO: Remove this later. THis only exists in case you use an older "react" package.
ctor = ((lazyComponent: any)._ctor: typeof ctor);
}
const ctor = lazyComponent._result;
const thenable = ctor();
// Transition to the next state.
const pending: PendingLazyComponent<any> = (lazyComponent: any);
Expand Down
14 changes: 0 additions & 14 deletions packages/shared/ReactSharedInternals.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,4 @@ import * as React from 'react';
const ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// Prevent newer renderers from RTE when used with older react package versions.
// Current owner and dispatcher used to share the same ref,
// but PR #14548 split them out to better support the react-debug-tools package.
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
ReactSharedInternals.ReactCurrentDispatcher = {
current: null,
};
}
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
ReactSharedInternals.ReactCurrentBatchConfig = {
suspense: null,
};
}

export default ReactSharedInternals;

0 comments on commit 2666642

Please sign in to comment.