mirror of
https://github.com/status-im/react-native.git
synced 2025-02-06 06:34:01 +00:00
Reviewed By: bvaughn, davidaurelio Differential Revision: D5618991 fbshipit-source-id: 8b93bca186523585732c2177540189a1d83f9c90
42 lines
1008 B
JavaScript
42 lines
1008 B
JavaScript
/**
|
|
* Copyright 2013-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactNativeFeatureFlags
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var useFiber;
|
|
|
|
var ReactNativeFeatureFlags = {
|
|
get useFiber(): boolean {
|
|
if (useFiber == null) {
|
|
useFiber = true;
|
|
if (__DEV__) {
|
|
require('Systrace').installReactHook(useFiber);
|
|
}
|
|
}
|
|
return useFiber;
|
|
},
|
|
set useFiber(enabled: boolean): void {
|
|
if (useFiber != null) {
|
|
throw new Error(
|
|
'Cannot set useFiber feature flag after it has been accessed. ' +
|
|
'Please override it before requiring React.',
|
|
);
|
|
}
|
|
useFiber = enabled;
|
|
if (__DEV__) {
|
|
require('Systrace').installReactHook(useFiber);
|
|
}
|
|
},
|
|
};
|
|
|
|
module.exports = ReactNativeFeatureFlags;
|