Don't support older isomorphic React with newer renderers (#18329)
* Don't support older isomorphic React with newer renderers * Remove the lazy hack
Dan Abramov committed
Mar 17, 2020 at 19:30 UTC
26666427d6ed5cbc581e65e43608fa1acec3bcf8
7 files changed
+6
-24
packages/react-art/package.json
+1
-1
@@ -29,7 +29,7 @@
29
"scheduler": "^0.19.0"
30
},
31
"peerDependencies": {
32
- "react": "^16.0.0"
32
+ "react": "^16.13.0"
33
},
34
"files": [
35
"LICENSE",
packages/react-dom/package.json
+1
-1
@@ -22,7 +22,7 @@
22
"scheduler": "^0.19.0"
23
},
24
"peerDependencies": {
25
- "react": "^16.0.0"
25
+ "react": "^16.13.0"
26
},
27
"files": [
28
"LICENSE",
packages/react-noop-renderer/package.json
+1
-1
@@ -18,7 +18,7 @@
18
"react-server": "*"
19
},
20
"peerDependencies": {
21
- "react": "^16.0.0"
21
+ "react": "^16.13.0"
22
},
23
"files": [
24
"LICENSE",
packages/react-reconciler/package.json
+1
-1
@@ -26,7 +26,7 @@
26
"node": ">=0.10.0"
27
},
28
"peerDependencies": {
29
- "react": "^16.0.0"
29
+ "react": "^16.13.0"
30
},
31
"dependencies": {
32
"loose-envify": "^1.1.0",
packages/react-test-renderer/package.json
+1
-1
@@ -25,7 +25,7 @@
25
"scheduler": "^0.19.0"
26
},
27
"peerDependencies": {
28
- "react": "^16.0.0"
28
+ "react": "^16.13.0"
29
},
30
"files": [
31
"LICENSE",
packages/shared/ReactLazyComponent.js
+1
-5
@@ -38,11 +38,7 @@ export function initializeLazyComponentType(
38
lazyComponent: LazyComponent<any>,
39
): void {
40
if (lazyComponent._status === Uninitialized) {
41
- let ctor = lazyComponent._result;
42
- if (!ctor) {
43
- // TODO: Remove this later. THis only exists in case you use an older "react" package.
44
- ctor = ((lazyComponent: any)._ctor: typeof ctor);
45
- }
41
+ const ctor = lazyComponent._result;
42
const thenable = ctor();
43
// Transition to the next state.
44
const pending: PendingLazyComponent<any> = (lazyComponent: any);
packages/shared/ReactSharedInternals.js
-14
@@ -12,18 +12,4 @@ import * as React from 'react';
12
const ReactSharedInternals =
13
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14
15
-// Prevent newer renderers from RTE when used with older react package versions.
16
-// Current owner and dispatcher used to share the same ref,
17
-// but PR #14548 split them out to better support the react-debug-tools package.
18
-if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
19
- ReactSharedInternals.ReactCurrentDispatcher = {
20
- current: null,
21
- };
22
-}
23
-if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
24
- ReactSharedInternals.ReactCurrentBatchConfig = {
25
- suspense: null,
26
- };
27
-}
28
-
15
export default ReactSharedInternals;