Skip to content

Commit dd60414

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Change flow types of RefreshControl.size prop
Summary: This diff changes the flow types of RefreshControl.size prop from 'int' to string'. For more context see previous diff of the stack. This diff will be landed as soon as the native release containing D25933458 (65975dd) goes to production. It's important to clarify that there are currently no usages of this prop in production Changelog: [Android][Changed] - RefreshControl.size prop changed its type to string, the valid values are: 'default' and 'large' Reviewed By: JoshuaGross Differential Revision: D25933457 fbshipit-source-id: 2f34566f2f8a097e6d40f63c09ecb3ada2fd8409
1 parent 5792c32 commit dd60414

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type NativeProps = $ReadOnly<{|
4141
*/
4242
progressBackgroundColor?: ?ColorValue,
4343
/**
44-
* Size of the refresh indicator, see RefreshControl.SIZE.
44+
* Size of the refresh indicator.
4545
*/
4646
size?: WithDefault<'default' | 'large', 'default'>,
4747
/**

Libraries/Components/RefreshControl/RefreshControl.js

+2-19
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ import PullToRefreshViewNativeComponent, {
2222
Commands as PullToRefreshCommands,
2323
} from './PullToRefreshViewNativeComponent';
2424

25-
let RefreshLayoutConsts: any;
26-
if (Platform.OS === 'android') {
27-
const AndroidSwipeRefreshLayout = require('../../ReactNative/UIManager').getViewManagerConfig(
28-
'AndroidSwipeRefreshLayout',
29-
);
30-
RefreshLayoutConsts = AndroidSwipeRefreshLayout
31-
? AndroidSwipeRefreshLayout.Constants
32-
: {SIZE: {}};
33-
} else {
34-
RefreshLayoutConsts = {SIZE: {}};
35-
}
36-
3725
type IOSProps = $ReadOnly<{|
3826
/**
3927
* The color of the refresh indicator.
@@ -63,12 +51,9 @@ type AndroidProps = $ReadOnly<{|
6351
*/
6452
progressBackgroundColor?: ?ColorValue,
6553
/**
66-
* Size of the refresh indicator, see RefreshControl.SIZE.
54+
* Size of the refresh indicator.
6755
*/
68-
size?: ?(
69-
| typeof RefreshLayoutConsts.SIZE.DEFAULT
70-
| typeof RefreshLayoutConsts.SIZE.LARGE
71-
),
56+
size?: ?('default' | 'large'),
7257
/**
7358
* Progress view top offset
7459
*/
@@ -137,8 +122,6 @@ export type RefreshControlProps = $ReadOnly<{|
137122
* in the `onRefresh` function otherwise the refresh indicator will stop immediately.
138123
*/
139124
class RefreshControl extends React.Component<RefreshControlProps> {
140-
static SIZE: any = RefreshLayoutConsts.SIZE;
141-
142125
_nativeRef: ?React.ElementRef<
143126
| typeof PullToRefreshViewNativeComponent
144127
| typeof AndroidSwipeRefreshLayoutNativeComponent,

0 commit comments

Comments
 (0)