mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Summary: This diff updates the flow types for the ActivityIndicator size prop. The android component [here](diffusion/FBS/browse/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.java$31-30) does not use a size prop The iOS component [here](diffusion/FBS/browse/master/xplat/js/react-native-github/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm;e82762cefe5cddad4a7e8144c42c76eb4d907e56$14-15,23) uses the size prop, but only for small/large, not for the number type Reviewed By: TheSavior Differential Revision: D14247432 fbshipit-source-id: 43b74574548eaf97f96d68c18ed627465fd5e133
61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* 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 requireNativeComponent = require('requireNativeComponent');
|
|
|
|
import type {ViewProps} from 'ViewPropTypes';
|
|
import type {ViewStyleProp} from 'StyleSheet';
|
|
import type {NativeComponent} from 'ReactNative';
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
/**
|
|
* Whether the indicator should hide when not animating (true by default).
|
|
*
|
|
* See http://facebook.github.io/react-native/docs/activityindicator.html#hideswhenstopped
|
|
*/
|
|
hidesWhenStopped?: ?boolean,
|
|
|
|
/**
|
|
* Whether to show the indicator (true, the default) or hide it (false).
|
|
*
|
|
* See http://facebook.github.io/react-native/docs/activityindicator.html#animating
|
|
*/
|
|
animating?: ?boolean,
|
|
|
|
/**
|
|
* The foreground color of the spinner (default is gray).
|
|
*
|
|
* See http://facebook.github.io/react-native/docs/activityindicator.html#color
|
|
*/
|
|
color?: ?string,
|
|
|
|
/**
|
|
* Size of the indicator (default is 'small').
|
|
* Passing a number to the size prop is only supported on Android.
|
|
*
|
|
* See http://facebook.github.io/react-native/docs/activityindicator.html#size
|
|
*/
|
|
size?: ?('small' | 'large'),
|
|
|
|
style?: ?ViewStyleProp,
|
|
styleAttr?: ?string,
|
|
indeterminate?: ?boolean,
|
|
|}>;
|
|
|
|
type ActivityIndicatorNativeType = Class<NativeComponent<NativeProps>>;
|
|
|
|
module.exports = ((requireNativeComponent(
|
|
'RCTActivityIndicatorView',
|
|
): any): ActivityIndicatorNativeType);
|