Skip to content

StatusBar: Remove PropTypes - #21293

Closed
empyrical wants to merge 2 commits into
react:masterfrom
empyrical:statusbar-types
Closed

StatusBar: Remove PropTypes#21293
empyrical wants to merge 2 commits into
react:masterfrom
empyrical:statusbar-types

Conversation

@empyrical

Copy link
Copy Markdown
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-botfacebook-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
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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-botfacebook-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

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@reactreact locked as resolved and limited conversation to collaborators Sep 24, 2018
@react-native-botreact-native-bot added the Merged This PR has been merged. label Sep 24, 2018
@hramoshramos 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: react#21293
Differential Revision: D10012963
Pulled By: TheSavior
fbshipit-source-id: 7fb4e416eb49e7860809a3e2aaf157590908687d
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@empyrical@react-native-bot@elicwhite@facebook-github-bot@hramos