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

Remove PropTypes from Modal.js #21279

Closed
wants to merge 4 commits into from

Conversation

empyrical
Copy link
Contributor

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

@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 Sep 23, 2018
Libraries/Modal/Modal.js Outdated Show resolved Hide resolved
|}>,
>;

export type ModalProps = $ReadOnly<{|
Copy link
Member

Choose a reason for hiding this comment

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

Lets not export these

*
* See https://facebook.github.io/react-native/docs/modal.html#supportedorientations
*/
supportedOrientations?: ?Array<
Copy link
Member

Choose a reason for hiding this comment

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

We prefer $ReadOnlyArray

Copy link

@analysis-bot analysis-bot left a 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 Show resolved Hide resolved
*
* See https://facebook.github.io/react-native/docs/modal.html#supportedorientations
*/
supportedOrientations?: ?ReadOnlyArray<
Copy link
Member

Choose a reason for hiding this comment

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

$ReadOnlyArray, missing the $

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 🤦‍♂️

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.

*
* See https://facebook.github.io/react-native/docs/modal.html#onrequestclose
*/
onRequestClose?: (event?: SyntheticEvent<null>) => mixed,
Copy link
Member

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,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

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.

@elicwhite
Copy link
Member

This caught a few invalid callsites internally that will have to get fixed for this to land.

@react-native-bot
Copy link
Collaborator

@empyrical merged commit 6b89214 into facebook:master.


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 master tag, it is not yet part of a release.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 24, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 24, 2018
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

5 participants