File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,19 @@ import React from 'react';
10
10
const ReactSharedInternals =
11
11
React . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ;
12
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
+
13
28
export default ReactSharedInternals ;
You can’t perform that action at this time.
0 commit comments