@@ -22,15 +22,27 @@ const ViewPropTypes = require('ViewPropTypes');
2222
2323const createReactClass = require ( 'create-react-class' ) ;
2424const requireNativeComponent = require ( 'requireNativeComponent' ) ;
25+
26+ import type { ViewProps } from 'ViewPropTypes' ;
27+
2528let RCTActivityIndicator ;
2629
2730const GRAY = '#999999' ;
2831
2932type IndicatorSize = number | 'small' | 'large' ;
3033
34+ type Props = $ReadOnly < { |
35+ ...ViewProps ,
36+
37+ animating ?: ?boolean ,
38+ color ?: ?string ,
39+ hidesWhenStopped ?: ?boolean ,
40+ size ?: ?IndicatorSize ,
41+ | } > ;
42+
3143type DefaultProps = {
3244 animating : boolean ,
33- color : any ,
45+ color : ? string ,
3446 hidesWhenStopped : boolean ,
3547 size : IndicatorSize ,
3648} ;
@@ -40,7 +52,7 @@ type DefaultProps = {
4052 *
4153 * See http://facebook.github.io/react-native/docs/activityindicator.html
4254 */
43- const ActivityIndicator = createReactClass ( {
55+ const ActivityIndicator = ( ( createReactClass ( {
4456 displayName : 'ActivityIndicator' ,
4557 mixins : [ NativeMethodsMixin ] ,
4658
@@ -81,7 +93,7 @@ const ActivityIndicator = createReactClass({
8193 getDefaultProps ( ) : DefaultProps {
8294 return {
8395 animating : true ,
84- color : Platform . OS === 'ios' ? GRAY : undefined ,
96+ color : Platform . OS === 'ios' ? GRAY : null ,
8597 hidesWhenStopped : true ,
8698 size : 'small' ,
8799 } ;
@@ -120,7 +132,7 @@ const ActivityIndicator = createReactClass({
120132 </ View >
121133 ) ;
122134 } ,
123- } ) ;
135+ } ) : any ) : React . ComponentType < Props > ) ;
124136
125137if ( Platform . OS === 'ios ') {
126138 RCTActivityIndicator = requireNativeComponent (
0 commit comments