Skip to content

Commit

Permalink
Change flow types of RefreshControl.size prop
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jan 26, 2021
1 parent 5792c32 commit dd60414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type NativeProps = $ReadOnly<{|
*/
progressBackgroundColor?: ?ColorValue,
/**
* Size of the refresh indicator, see RefreshControl.SIZE.
* Size of the refresh indicator.
*/
size?: WithDefault<'default' | 'large', 'default'>,
/**
Expand Down
21 changes: 2 additions & 19 deletions Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ import PullToRefreshViewNativeComponent, {
Commands as PullToRefreshCommands,
} from './PullToRefreshViewNativeComponent';

let RefreshLayoutConsts: any;
if (Platform.OS === 'android') {
const AndroidSwipeRefreshLayout = require('../../ReactNative/UIManager').getViewManagerConfig(
'AndroidSwipeRefreshLayout',
);
RefreshLayoutConsts = AndroidSwipeRefreshLayout
? AndroidSwipeRefreshLayout.Constants
: {SIZE: {}};
} else {
RefreshLayoutConsts = {SIZE: {}};
}

type IOSProps = $ReadOnly<{|
/**
* The color of the refresh indicator.
Expand Down Expand Up @@ -63,12 +51,9 @@ type AndroidProps = $ReadOnly<{|
*/
progressBackgroundColor?: ?ColorValue,
/**
* Size of the refresh indicator, see RefreshControl.SIZE.
* Size of the refresh indicator.
*/
size?: ?(
| typeof RefreshLayoutConsts.SIZE.DEFAULT
| typeof RefreshLayoutConsts.SIZE.LARGE
),
size?: ?('default' | 'large'),
/**
* Progress view top offset
*/
Expand Down Expand Up @@ -137,8 +122,6 @@ export type RefreshControlProps = $ReadOnly<{|
* in the `onRefresh` function otherwise the refresh indicator will stop immediately.
*/
class RefreshControl extends React.Component<RefreshControlProps> {
static SIZE: any = RefreshLayoutConsts.SIZE;

_nativeRef: ?React.ElementRef<
| typeof PullToRefreshViewNativeComponent
| typeof AndroidSwipeRefreshLayoutNativeComponent,
Expand Down

0 comments on commit dd60414

Please sign in to comment.