Skip to content

Commit 3e15b1c

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

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
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+
exportdefaultrequire('ReactCurrentDispatcher');

‎scripts/rollup/forks.js‎

Lines changed: 13 additions & 0 deletions
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+
caseFB_WWW_DEV:
226+
caseFB_WWW_PROD:
227+
caseFB_WWW_PROFILING:
228+
return'react/src/forks/ReactCurrentDispatcher.www.js';
229+
default:
230+
returnnull;
231+
}
232+
},
233+
221234
// Different wrapping/reporting for caught errors.
222235
'shared/invokeGuardedCallbackImpl': (bundleType,entry)=>{
223236
switch(bundleType){

0 commit comments

Comments
 (0)