Skip to content

Commit 3e15b1c

Browse files
author
Sunil Pai
authored
make a fork for ReactCurrentDispatcher (#14588)
1 parent 0005d1e commit 3e15b1c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
export default require('ReactCurrentDispatcher');

Diff for: scripts/rollup/forks.js

+13
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ const forks = Object.freeze({
218218
}
219219
},
220220

221+
// Similarly, we preserve an inline require to ReactCurrentDispatcher.
222+
// See the explanation in FB version of ReactCurrentDispatcher in www:
223+
'react/src/ReactCurrentDispatcher': (bundleType, entry) => {
224+
switch (bundleType) {
225+
case FB_WWW_DEV:
226+
case FB_WWW_PROD:
227+
case FB_WWW_PROFILING:
228+
return 'react/src/forks/ReactCurrentDispatcher.www.js';
229+
default:
230+
return null;
231+
}
232+
},
233+
221234
// Different wrapping/reporting for caught errors.
222235
'shared/invokeGuardedCallbackImpl': (bundleType, entry) => {
223236
switch (bundleType) {

0 commit comments

Comments
 (0)