diff --git a/Libraries/ReactNative/ReactFabricIndicator.js b/Libraries/ReactNative/ReactFabricIndicator.js new file mode 100644 index 000000000..23b95f8c1 --- /dev/null +++ b/Libraries/ReactNative/ReactFabricIndicator.js @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow + */ + +'use strict'; + +const React = require('React'); +const StyleSheet = require('StyleSheet'); +const Text = require('Text'); +const View = require('View'); + +function ReactFabricIndicator(): React.Node { + return ( + + FABRIC + + ); +} + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center', + backgroundColor: 'rgba(0,0,0, 0.25)', + position: 'absolute', + top: 0, + right: 0, + padding: 2, + }, + text: { + fontSize: 6, + color: '#ffffff', + }, +}); + +module.exports = ReactFabricIndicator; diff --git a/Libraries/ReactNative/renderApplication.js b/Libraries/ReactNative/renderApplication.js index 7d699f754..193262fc6 100644 --- a/Libraries/ReactNative/renderApplication.js +++ b/Libraries/ReactNative/renderApplication.js @@ -12,6 +12,7 @@ const AppContainer = require('AppContainer'); const React = require('React'); +const ReactFabricIndicator = require('ReactFabricIndicator'); const invariant = require('fbjs/lib/invariant'); @@ -24,12 +25,16 @@ function renderApplication( rootTag: any, WrapperComponent?: ?React.ComponentType<*>, fabric?: boolean, + showFabricIndicator?: boolean, ) { invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); let renderable = ( + {fabric === true && showFabricIndicator === true ? ( + + ) : null} );