From ff6a53de2a563d0be1edf726654ed881789ec00a Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 3 Dec 2018 14:54:26 -0800 Subject: [PATCH] Make type of RefreshControl.onRefresh less strict (#22376) Summary: I think a common pattern is to use async functions with the onRefresh prop to reload data. I made the type `mixed` since we don't care about what the function returns. Could also be `void | Promise` I haven't really seen a pattern for those in the codebase. Pull Request resolved: https://github.com/facebook/react-native/pull/22376 Differential Revision: D13310372 Pulled By: TheSavior fbshipit-source-id: 445f28cf2c37f9c937e72d76716002deaf9d9c94 --- 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 556b06e5d57536..ac6853e2addcb5 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?: ?() => void, + onRefresh?: ?() => mixed, /** * Whether the view should be indicating an active refresh.