diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 6f9d34966..a520b6579 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -21,6 +21,7 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); +let RCTActivityIndicator; const GRAY = '#999999'; @@ -120,6 +121,14 @@ const ActivityIndicator = createReactClass({ } }); +if (Platform.OS === 'ios') { + RCTActivityIndicator = requireNativeComponent( + 'RCTActivityIndicatorView', + ActivityIndicator, + { nativeOnly: { activityIndicatorViewStyle: true } } + ); +} + const styles = StyleSheet.create({ container: { alignItems: 'center', @@ -135,12 +144,4 @@ const styles = StyleSheet.create({ }, }); -if (Platform.OS === 'ios') { - var RCTActivityIndicator = requireNativeComponent( - 'RCTActivityIndicatorView', - ActivityIndicator, - { nativeOnly: { activityIndicatorViewStyle: true } } - ); -} - module.exports = ActivityIndicator; diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 383e7e6ac..6b812a2cf 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -39,6 +39,10 @@ const requireNativeComponent = require('requireNativeComponent'); * run Flow. */ const warning = require('fbjs/lib/warning'); +let AndroidTextInput; +let RCTMultilineTextInputView; +let RCTSinglelineTextInputView; + const onlyMultiline = { onTextInput: true, children: true, @@ -47,13 +51,13 @@ const onlyMultiline = { import type {ViewChildContext} from 'ViewContext'; if (Platform.OS === 'android') { - var AndroidTextInput = requireNativeComponent('AndroidTextInput', null); + AndroidTextInput = requireNativeComponent('AndroidTextInput', null); } else if (Platform.OS === 'ios') { - var RCTMultilineTextInputView = requireNativeComponent( + RCTMultilineTextInputView = requireNativeComponent( 'RCTMultilineTextInputView', null, ); - var RCTSinglelineTextInputView = requireNativeComponent( + RCTSinglelineTextInputView = requireNativeComponent( 'RCTSinglelineTextInputView', null, );