From 84c541661729dd20ab260c7468e48abbbe82affb Mon Sep 17 00:00:00 2001 From: Thomas BARRAS Date: Mon, 5 Nov 2018 13:52:23 -0800 Subject: [PATCH] Flow type RefreshControl (#22119) Summary: Related to #22100 Enhance Flow types for RefreshControl specifying `onRefresh` props type. There are still 2 `any` left using `requireNativeComponent` that need to be addressed to turn Flow to strict mode. I went through `RCTRefreshControl` and `AndroidSwipeRefreshLayout` classes to understand where this method came from. - All flow tests succeed. [GENERAL] [ENHANCEMENT] [RefreshControl.js] - Flow onRefresh type Pull Request resolved: https://github.com/facebook/react-native/pull/22119 Differential Revision: D12919764 Pulled By: TheSavior fbshipit-source-id: 9ba675be8dbce77d77972acb904fc13c68524831 --- Libraries/Components/RefreshControl/RefreshControl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index 98ce10af6d0..556b06e5d57 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -87,7 +87,7 @@ export type RefreshControlProps = $ReadOnly<{| /** * Called when the view starts refreshing. */ - onRefresh?: ?Function, + onRefresh?: ?() => void, /** * Whether the view should be indicating an active refresh.