-
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
Remove PropTypes from Modal.js #21279
Conversation
Libraries/Modal/Modal.js
Outdated
|}>, | ||
>; | ||
|
||
export type ModalProps = $ReadOnly<{| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not export these
Libraries/Modal/Modal.js
Outdated
* | ||
* See https://facebook.github.io/react-native/docs/modal.html#supportedorientations | ||
*/ | ||
supportedOrientations?: ?Array< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer $ReadOnlyArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint
found some issues. You may run yarn prettier
or npm run prettier
to fix these.
Libraries/Modal/Modal.js
Outdated
* | ||
* See https://facebook.github.io/react-native/docs/modal.html#supportedorientations | ||
*/ | ||
supportedOrientations?: ?ReadOnlyArray< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ReadOnlyArray
, missing the $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 🤦♂️
There was a problem hiding this 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.
Libraries/Modal/Modal.js
Outdated
* | ||
* See https://facebook.github.io/react-native/docs/modal.html#onrequestclose | ||
*/ | ||
onRequestClose?: (event?: SyntheticEvent<null>) => mixed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff fails to land internally because of callsites that pass null to onRequestClose
. We typically like to make optional arguments nullable to enable spreading props and other things to work. Can you update this type and the others in this diff that are optional to also be nullable?
onRequestClose?: ?(event?: SyntheticEvent<null>) => mixed,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this 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.
This caught a few invalid callsites internally that will have to get fixed for this to land. |
@empyrical merged commit 6b89214 into Once this commit is added to a release, you will see the corresponding version tag below the description at 6b89214. If the commit has a single |
Summary: This PR converts the Prop Types in `Modal` to Flow Types, and fills out the callback types a bit more. Context Types are left in for now. Pull Request resolved: facebook#21279 Reviewed By: yungsters Differential Revision: D10006795 Pulled By: TheSavior fbshipit-source-id: ac885f2e5f068b0991009a9b1cbb3886e34941af
This PR converts the Prop Types in
Modal
to Flow Types, and fills out the callback types a bit more.Context Types are left in for now.
Test Plan:
flow check
passes.Release Notes:
[GENERAL] [ENHANCEMENT] [Libraries/Modal/Modal.js] - Converted Prop Types to Flow Types