2017-02-15 03:58:24 +00:00
|
|
|
/**
|
|
|
|
* 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
|
2017-03-20 23:22:24 +00:00
|
|
|
* @flow
|
2017-09-25 05:57:35 +00:00
|
|
|
* @format
|
2017-02-15 03:58:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2017-08-15 17:45:35 +00:00
|
|
|
// =============================================================================
|
|
|
|
// IMPORTANT:
|
|
|
|
// When syncing React Renderer, make sure the feature flags are still compatible
|
|
|
|
// =============================================================================
|
|
|
|
|
2017-08-14 17:51:16 +00:00
|
|
|
var useFiber;
|
|
|
|
|
2017-02-15 03:58:24 +00:00
|
|
|
var ReactNativeFeatureFlags = {
|
2017-08-14 17:51:16 +00:00
|
|
|
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. ' +
|
2017-09-25 05:57:35 +00:00
|
|
|
'Please override it before requiring React.',
|
2017-08-14 17:51:16 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
useFiber = enabled;
|
|
|
|
if (__DEV__) {
|
|
|
|
require('Systrace').installReactHook(useFiber);
|
|
|
|
}
|
|
|
|
},
|
2017-02-15 03:58:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ReactNativeFeatureFlags;
|