We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0975ea3 commit 8ab0da5Copy full SHA for 8ab0da5
packages/shared/ReactSharedInternals.js
@@ -10,4 +10,19 @@ import React from 'react';
10
const ReactSharedInternals =
11
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
12
13
+// Add fallabck for newer renderers running with older react package versions.
14
+// Current owner and dispatcher used to share the same ref,
15
+// but PR #14548 split them out to better support the react-debug-tools package.
16
+if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
17
+ const {ReactCurrentOwner} = ReactSharedInternals;
18
+ ReactSharedInternals.ReactCurrentDispatcher = {
19
+ get current() {
20
+ return ReactCurrentOwner.currentDispatcher;
21
+ },
22
+ set current(value) {
23
+ ReactCurrentOwner.currentDispatcher = value;
24
25
+ };
26
+}
27
+
28
export default ReactSharedInternals;
0 commit comments