Skip to content

Commit

Permalink
Make type of RefreshControl.onRefresh less strict (#22376)
Browse files Browse the repository at this point in the history
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<void>` I haven't really seen a pattern for those in the codebase.
Pull Request resolved: #22376

Differential Revision: D13310372

Pulled By: TheSavior

fbshipit-source-id: 445f28cf2c37f9c937e72d76716002deaf9d9c94
  • Loading branch information
janicduplessis authored and facebook-github-bot committed Dec 3, 2018
1 parent 2330843 commit ff6a53d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ff6a53d

Please sign in to comment.