Skip to content

Commit

Permalink
Fork ReactDOMSharedInternals
Browse files Browse the repository at this point in the history
  • Loading branch information
poteto committed Oct 25, 2022
1 parent 1dde1ab commit 721878e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/shared/forks/ReactDOMSharedInternals.www.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

// $FlowIgnore[cannot-resolve-module] provided by www
const ReactDOM = require('ReactDOMComet');

const ReactDOMSharedInternals =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

export default ReactDOMSharedInternals;
8 changes: 8 additions & 0 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ const forks = Object.freeze({
if (entry === 'react-dom' || entry === 'react-dom/server-rendering-stub') {
return './packages/react-dom/src/ReactDOMSharedInternals.js';
}
switch (bundleType) {
case FB_WWW_DEV:
case FB_WWW_PROD:
case FB_WWW_PROFILING:
return './packages/shared/forks/ReactDOMSharedInternals.www.js';
default:
break;
}
if (
!entry.startsWith('react-dom/') &&
dependencies.indexOf('react-dom') === -1
Expand Down

0 comments on commit 721878e

Please sign in to comment.