main
js 23 lines 934 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and 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 * @flow
8 */
9
10 // These globals are set by React Native (e.g. in setUpDOM.js, setUpTimers.js)
11 // and provide access to RN's feature flags. We use global functions because we
12 // don't have another mechanism to pass feature flags from RN to React in OSS.
13 // Values are lazily evaluated and cached on first access.
14
15 let _enableNativeEventTargetEventDispatching: boolean | null = null;
16 export function enableNativeEventTargetEventDispatching(): boolean {
17 if (_enableNativeEventTargetEventDispatching == null) {
18 _enableNativeEventTargetEventDispatching =
19 typeof RN$isNativeEventTargetEventDispatchingEnabled === 'function' &&
20 RN$isNativeEventTargetEventDispatchingEnabled();
21 }
22 return _enableNativeEventTargetEventDispatching;
23 }