Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change onRefresh flow typing #28167

Closed
wants to merge 2 commits into from
Closed

Conversation

vonovak
Copy link
Contributor

@vonovak vonovak commented Feb 24, 2020

Summary

I propose this change because we (and a lot of other people, I'd guess) pass an async function as a parameter to onRefresh. Because the async function returns a promise, flow is reporting an error. I think the type checking here can be relaxed either all the way to any (because RN does not care here what we return) or to void | Promise<void> to account for async functions.

looking at fb7b2d3#diff-a9c5687ae65236ba3e7f34bfdcdec81d seems like the second is preferred

Changelog

[General] [changed] - relax RefreshControl's onRefresh flow typing

Test Plan

  • flow passes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 24, 2020
@analysis-bot
Copy link

RNTester (Android/hermes/arm64-v8a): 3291136 bytes
RNTester (Android/hermes/armeabi-v7a): 3131392 bytes
RNTester (Android/hermes/x86): 3463168 bytes
RNTester (Android/hermes/x86_64): 3426304 bytes
RNTester (Android/jsc/arm64-v8a): 4446208 bytes
RNTester (Android/jsc/armeabi-v7a): 4268032 bytes
RNTester (Android/jsc/x86): 4360192 bytes
RNTester (Android/jsc/x86_64): 4646912 bytes

@analysis-bot
Copy link

RNTester.app (iOS): 10657792 bytes

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheSavior has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @vonovak in 884c86a.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 4, 2020
osdnk pushed a commit to osdnk/react-native that referenced this pull request Mar 9, 2020
Summary:
I propose this change because we (and a lot of other people, I'd guess) pass an `async` function as a parameter to `onRefresh`. Because the `async` function returns a `promise`, flow is reporting an error. I think the type checking here can be relaxed either all the way to `any` (because RN does not care here what we return) or to `void | Promise<void>` to account for async functions.

looking at facebook@fb7b2d3#diff-a9c5687ae65236ba3e7f34bfdcdec81d seems like the second is preferred

## Changelog

[General] [changed] - relax RefreshControl's onRefresh flow typing
Pull Request resolved: facebook#28167

Test Plan: * flow passes

Reviewed By: hramos

Differential Revision: D20196529

Pulled By: TheSavior

fbshipit-source-id: bb5a314bcfb5fb9c8ab71eccb449f1322aeebacb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants