Avoid var specific hoisting rules
Reviewed By: sahrens Differential Revision: D7116184 fbshipit-source-id: 4fd1654028e52f5aafad348546b889f1737c7399
This commit is contained in:
parent
78b30659bc
commit
7216079a79
|
@ -21,6 +21,7 @@ const ViewPropTypes = require('ViewPropTypes');
|
||||||
|
|
||||||
const createReactClass = require('create-react-class');
|
const createReactClass = require('create-react-class');
|
||||||
const requireNativeComponent = require('requireNativeComponent');
|
const requireNativeComponent = require('requireNativeComponent');
|
||||||
|
let RCTActivityIndicator;
|
||||||
|
|
||||||
const GRAY = '#999999';
|
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({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
alignItems: 'center',
|
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;
|
module.exports = ActivityIndicator;
|
||||||
|
|
|
@ -39,6 +39,10 @@ const requireNativeComponent = require('requireNativeComponent');
|
||||||
* run Flow. */
|
* run Flow. */
|
||||||
const warning = require('fbjs/lib/warning');
|
const warning = require('fbjs/lib/warning');
|
||||||
|
|
||||||
|
let AndroidTextInput;
|
||||||
|
let RCTMultilineTextInputView;
|
||||||
|
let RCTSinglelineTextInputView;
|
||||||
|
|
||||||
const onlyMultiline = {
|
const onlyMultiline = {
|
||||||
onTextInput: true,
|
onTextInput: true,
|
||||||
children: true,
|
children: true,
|
||||||
|
@ -47,13 +51,13 @@ const onlyMultiline = {
|
||||||
import type {ViewChildContext} from 'ViewContext';
|
import type {ViewChildContext} from 'ViewContext';
|
||||||
|
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);
|
AndroidTextInput = requireNativeComponent('AndroidTextInput', null);
|
||||||
} else if (Platform.OS === 'ios') {
|
} else if (Platform.OS === 'ios') {
|
||||||
var RCTMultilineTextInputView = requireNativeComponent(
|
RCTMultilineTextInputView = requireNativeComponent(
|
||||||
'RCTMultilineTextInputView',
|
'RCTMultilineTextInputView',
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
var RCTSinglelineTextInputView = requireNativeComponent(
|
RCTSinglelineTextInputView = requireNativeComponent(
|
||||||
'RCTSinglelineTextInputView',
|
'RCTSinglelineTextInputView',
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue