-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Accept TypeScript type T | null | undefined as a maybe type of T in turbo module #34158
Conversation
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
86a9a55
to
584e37f
Compare
Thanks! Isn't it also the case that |
@yungsters Although TypeScript compiler doesn't limit where you could use |
584e37f
to
3bbb520
Compare
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @ZihanChen-MSFT, could you please rebase this PR? There are some errors internally that a rebase could fix. Thanks! |
3bbb520
to
4f8354e
Compare
@cipolleschi done! |
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @ZihanChen-MSFT in 9ecd203. When will my fix make it into a release? | Upcoming Releases |
…urbo module (#34158) Summary: According Flow's document, a maybe type of T means `T | null | undefined`, instead of `T | null | void`. I think keeping TypeScript and Flow being consistent to each other is better. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - Accept TypeScript type `T | null | undefined` as a maybe type of T in turbo module. Pull Request resolved: #34158 Test Plan: `yarn jest` passed in `packages/react-native-codegen` Reviewed By: yungsters Differential Revision: D37731169 Pulled By: philIip fbshipit-source-id: b6d9b7e8991f60e12c1004bed5b937b34fb02c47
Summary
According Flow's document, a maybe type of T means
T | null | undefined
, instead ofT | null | void
.I think keeping TypeScript and Flow being consistent to each other is better.
Changelog
[General] [Changed] - Accept TypeScript type
T | null | undefined
as a maybe type of T in turbo module.Test Plan
yarn jest
passed inpackages/react-native-codegen