Skip to content

Commit 23a300f

Browse files
coadofacebook-github-bot
authored andcommitted
Add RefreshControl to buildTypes and align Flow with TS types (#49564)
Summary: Changelog: [Internal] - Added RefreshControl to buildTypes and aligned Flow with TS types Reviewed By: huntie Differential Revision: D69924368
1 parent bce6aa2 commit 23a300f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import React from 'react';
2121

2222
const Platform = require('../../Utilities/Platform').default;
2323

24-
type IOSProps = $ReadOnly<{
24+
export type RefreshControlPropsIOS = $ReadOnly<{
2525
/**
2626
* The color of the refresh indicator.
2727
*/
@@ -36,7 +36,7 @@ type IOSProps = $ReadOnly<{
3636
title?: ?string,
3737
}>;
3838

39-
type AndroidProps = $ReadOnly<{
39+
export type RefreshControlPropsAndroid = $ReadOnly<{
4040
/**
4141
* Whether the pull to refresh functionality is enabled.
4242
*/
@@ -57,8 +57,8 @@ type AndroidProps = $ReadOnly<{
5757

5858
export type RefreshControlProps = $ReadOnly<{
5959
...ViewProps,
60-
...IOSProps,
61-
...AndroidProps,
60+
...RefreshControlPropsIOS,
61+
...RefreshControlPropsAndroid,
6262

6363
/**
6464
* Called when the view starts refreshing.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,21 +1692,21 @@ declare export default typeof PullToRefreshViewNativeComponent;
16921692
`;
16931693

16941694
exports[`public API should not change unintentionally Libraries/Components/RefreshControl/RefreshControl.js 1`] = `
1695-
"type IOSProps = $ReadOnly<{
1695+
"export type RefreshControlPropsIOS = $ReadOnly<{
16961696
tintColor?: ?ColorValue,
16971697
titleColor?: ?ColorValue,
16981698
title?: ?string,
16991699
}>;
1700-
type AndroidProps = $ReadOnly<{
1700+
export type RefreshControlPropsAndroid = $ReadOnly<{
17011701
enabled?: ?boolean,
17021702
colors?: ?$ReadOnlyArray<ColorValue>,
17031703
progressBackgroundColor?: ?ColorValue,
17041704
size?: ?(\\"default\\" | \\"large\\"),
17051705
}>;
17061706
export type RefreshControlProps = $ReadOnly<{
17071707
...ViewProps,
1708-
...IOSProps,
1709-
...AndroidProps,
1708+
...RefreshControlPropsIOS,
1709+
...RefreshControlPropsAndroid,
17101710
onRefresh?: ?() => void | Promise<void>,
17111711
refreshing: boolean,
17121712
progressViewOffset?: ?number,

scripts/build/build-types/buildTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const ENTRY_POINTS = [
6565
'packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js',
6666
'packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js',
6767
'packages/react-native/Libraries/Modal/Modal.js',
68+
'packages/react-native/Libraries/Components/RefreshControl/RefreshControl.js',
6869
];
6970

7071
/**

0 commit comments

Comments
 (0)