Skip to content

Commit f8627e5

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Align ActivityIndicator with OSS types (#49519)
Summary: Pull Request resolved: #49519 Changelog: [Internal] Reviewed By: huntie Differential Revision: D69661567 fbshipit-source-id: 35e3849eeea188f8bdfa0664c90d3d9e5328ef80
1 parent 3f3066f commit f8627e5

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ const GRAY = '#999999';
2626

2727
type IndicatorSize = number | 'small' | 'large';
2828

29-
type IOSProps = $ReadOnly<{
29+
type ActivityIndicatorIOSProps = $ReadOnly<{
3030
/**
3131
Whether the indicator should hide when not animating.
3232
3333
@platform ios
3434
*/
3535
hidesWhenStopped?: ?boolean,
3636
}>;
37-
type Props = $ReadOnly<{
37+
export type ActivityIndicatorProps = $ReadOnly<{
3838
...ViewProps,
39-
...IOSProps,
39+
...ActivityIndicatorIOSProps,
4040

4141
/**
4242
Whether to show the indicator (`true`) or hide it (`false`).
@@ -69,7 +69,7 @@ const ActivityIndicator = (
6969
size = 'small',
7070
style,
7171
...restProps
72-
}: Props,
72+
}: ActivityIndicatorProps,
7373
forwardedRef?: any,
7474
) => {
7575
let sizeStyle;
@@ -154,8 +154,8 @@ const ActivityIndicator = (
154154
*/
155155

156156
const ActivityIndicatorWithRef: component(
157-
ref: React.RefSetter<HostComponent<empty>>,
158-
...props: Props
157+
ref?: React.RefSetter<HostComponent<empty>>,
158+
...props: ActivityIndicatorProps
159159
) = React.forwardRef(ActivityIndicator);
160160
ActivityIndicatorWithRef.displayName = 'ActivityIndicator';
161161

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,19 +1382,19 @@ declare export default typeof legacySendAccessibilityEvent;
13821382

13831383
exports[`public API should not change unintentionally Libraries/Components/ActivityIndicator/ActivityIndicator.js 1`] = `
13841384
"type IndicatorSize = number | \\"small\\" | \\"large\\";
1385-
type IOSProps = $ReadOnly<{
1385+
type ActivityIndicatorIOSProps = $ReadOnly<{
13861386
hidesWhenStopped?: ?boolean,
13871387
}>;
1388-
type Props = $ReadOnly<{
1388+
export type ActivityIndicatorProps = $ReadOnly<{
13891389
...ViewProps,
1390-
...IOSProps,
1390+
...ActivityIndicatorIOSProps,
13911391
animating?: ?boolean,
13921392
color?: ?ColorValue,
13931393
size?: ?IndicatorSize,
13941394
}>;
13951395
declare const ActivityIndicatorWithRef: component(
1396-
ref: React.RefSetter<HostComponent<empty>>,
1397-
...props: Props
1396+
ref?: React.RefSetter<HostComponent<empty>>,
1397+
...props: ActivityIndicatorProps
13981398
);
13991399
declare export default typeof ActivityIndicatorWithRef;
14001400
"

scripts/build/build-types/buildTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const ENTRY_POINTS = [
3636
'packages/react-native/Libraries/Blob/URL.js',
3737
'packages/react-native/Libraries/Blob/URLSearchParams.js',
3838
'packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js',
39+
'packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js',
3940
'packages/react-native/Libraries/Components/Clipboard/Clipboard.js',
4041
'packages/react-native/Libraries/Components/LayoutConformance/LayoutConformance.js',
4142
'packages/react-native/Libraries/Components/ToastAndroid/ToastAndroid.js',

0 commit comments

Comments
 (0)