@samitouri / QOS-React / commits / 3e15b1c690

make a fork for ReactCurrentDispatcher (#14588)

Sunil Pai committed Jan 14, 2019 at 16:35 UTC 3e15b1c69014ad6767eac645228a052df861edc0
2 files changed +21
packages/react/src/forks/ReactCurrentDispatcher.www.js new
+8
@@ -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');
scripts/rollup/forks.js
+13
@@ -218,6 +218,19 @@ const forks = Object.freeze({
218 }
219 },
220
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 +
234 // Different wrapping/reporting for caught errors.
235 'shared/invokeGuardedCallbackImpl': (bundleType, entry) => {
236 switch (bundleType) {