Skip to content

Commit

Permalink
Re-export injectEventPluginsByName from ReactDOM internals
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Dail committed Sep 8, 2018
1 parent 3575ab7 commit e9ade0f
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 184 deletions.
1 change: 1 addition & 0 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ const ReactDOM: Object = {
ReactDOMComponentTree.getInstanceFromNode,
ReactDOMComponentTree.getNodeFromInstance,
ReactDOMComponentTree.getFiberCurrentPropsFromNode,
EventPluginHub.injection.injectEventPluginsByName,
EventPluginRegistry.eventNameDispatchConfigs,
EventPropagators.accumulateTwoPhaseDispatches,
EventPropagators.accumulateDirectDispatches,
Expand Down
1 change: 1 addition & 0 deletions packages/react-dom/src/test-utils/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const [
/* eslint-disable no-unused-vars */
getNodeFromInstance,
getFiberCurrentPropsFromNode,
injectEventPluginsByName,
/* eslint-enable no-unused-vars */
eventNameDispatchConfigs,
accumulateTwoPhaseDispatches,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@
*/

import ReactDOM from 'react-dom';
import * as EventPluginHub from 'events/EventPluginHub';
import * as EventPluginUtils from 'events/EventPluginUtils';
import ResponderEventPlugin from 'events/ResponderEventPlugin';
import ResponderTouchHistoryStore from 'events/ResponderTouchHistoryStore';

export {ResponderEventPlugin, ResponderTouchHistoryStore, EventPluginHub};

// Inject react-dom's ComponentTree into this module.
// Keep in sync with ReactDOM.js and ReactTestUtils.js:
const [
getInstanceFromNode,
getNodeFromInstance,
getFiberCurrentPropsFromNode,
injectEventPluginsByName,
] = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;

EventPluginUtils.setComponentTree(
getFiberCurrentPropsFromNode,
getInstanceFromNode,
getNodeFromInstance,
);

export {
ResponderEventPlugin,
ResponderTouchHistoryStore,
injectEventPluginsByName,
};
Loading

0 comments on commit e9ade0f

Please sign in to comment.