Skip to content

Commit

Permalink
Replaced current owner forward with current:null
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Feb 6, 2019
1 parent e8404c7 commit 6e638c9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/shared/ReactSharedInternals.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ import React from 'react';
const ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// Add fallback for newer renderers running with older react package versions.
// 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')) {
const {ReactCurrentOwner} = ReactSharedInternals;
ReactSharedInternals.ReactCurrentDispatcher = {
get current() {
return ReactCurrentOwner.currentDispatcher;
},
set current(value) {
ReactCurrentOwner.currentDispatcher = value;
},
current: null,
};
}

Expand Down

0 comments on commit 6e638c9

Please sign in to comment.