forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add react-dom-unstable-native-dependencies
react-native-web and react-primitives currently access a few internals for shimming DOM events into native ones. Changes in react@16 packaging hide these internals completely. This change adds a submodule to react-dom, unstable-native-dependencies that includes the necessary modules to continue enabling that method of dom-native event injection.
- Loading branch information
Showing
4 changed files
with
134 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-dom-unstable-native-dependencies.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-dom-unstable-native-dependencies.development.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/renderers/dom/shared/ReactDOMUnstableNativeDependenciesEntry.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule ReactDOMUnstableNativeDependenciesEntry | ||
*/ | ||
|
||
const ResponderEventPlugin = require('ResponderEventPlugin'); | ||
const ResponderTouchHistoryStore = require('ResponderTouchHistoryStore'); | ||
|
||
const ReactDOMUnstableNativeDependencies = { | ||
ResponderEventPlugin, | ||
ResponderTouchHistoryStore, | ||
}; | ||
|
||
// Inject react-dom's ComponentTree into this module. | ||
const EventPluginUtils = require('EventPluginUtils'); | ||
const ReactDOM = require('react-dom'); | ||
const { | ||
ReactDOMComponentTree, | ||
} = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
EventPluginUtils.injection.injectComponentTree(ReactDOMComponentTree); | ||
|
||
module.exports = ReactDOMUnstableNativeDependencies; |