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

StatusBar: Remove PropTypes #21293

Closed
wants to merge 2 commits into from
Closed

Conversation

empyrical
Copy link
Contributor

Part of: react-native-community/discussions-and-proposals#29

This PR removes the remaining PropTypes from StatusBar and moves its flowtypes to its own definition.

Test Plan:

flow check passes for android and ios.

Release Notes:

[GENERAL] [ENHANCEMENT] [Libraries/Components/StatusBar/StatusBar.js] - Removed PropTypes

@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 24, 2018
type DefaultProps = {
animated: boolean,
};
type StatusBarProps = $ReadOnly<{|
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd prefer if you just named these types Props. I believe that is consistent with all the other files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed it

* The background color of the status bar.
* @platform android
*/
backgroundColor?: ?string,
Copy link
Member

Choose a reason for hiding this comment

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

When there are a bunch of Props that are supported on different platforms, I like doing this pattern:

type AndroidProps = //
type IOSProps = //

type Props = $ReadOnly<{|
  ...IOSProps,
  ...AndroidProps,
  // shared props
|}>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And also re-organized these

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Sep 24, 2018
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 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@empyrical merged commit cd1d3ce into facebook:master.


Once this commit is added to a release, you will see the corresponding version tag below the description at cd1d3ce. 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
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Part of: react-native-community/discussions-and-proposals#29

This PR removes the remaining PropTypes from `StatusBar` and moves its flowtypes to its own definition.
Pull Request resolved: facebook#21293

Differential Revision: D10012963

Pulled By: TheSavior

fbshipit-source-id: 7fb4e416eb49e7860809a3e2aaf157590908687d
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