diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index a3bf769f7..7438d1e35 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -22,15 +22,27 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); + +import type {ViewProps} from 'ViewPropTypes'; + let RCTActivityIndicator; const GRAY = '#999999'; type IndicatorSize = number | 'small' | 'large'; +type Props = $ReadOnly<{| + ...ViewProps, + + animating?: ?boolean, + color?: ?string, + hidesWhenStopped?: ?boolean, + size?: ?IndicatorSize, +|}>; + type DefaultProps = { animating: boolean, - color: any, + color: ?string, hidesWhenStopped: boolean, size: IndicatorSize, }; @@ -40,7 +52,7 @@ type DefaultProps = { * * See http://facebook.github.io/react-native/docs/activityindicator.html */ -const ActivityIndicator = createReactClass({ +const ActivityIndicator = ((createReactClass({ displayName: 'ActivityIndicator', mixins: [NativeMethodsMixin], @@ -81,7 +93,7 @@ const ActivityIndicator = createReactClass({ getDefaultProps(): DefaultProps { return { animating: true, - color: Platform.OS === 'ios' ? GRAY : undefined, + color: Platform.OS === 'ios' ? GRAY : null, hidesWhenStopped: true, size: 'small', }; @@ -120,7 +132,7 @@ const ActivityIndicator = createReactClass({ ); }, -}); +}): any): React.ComponentType); if (Platform.OS === 'ios') { RCTActivityIndicator = requireNativeComponent(