-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
StatusBar: Remove PropTypes #21293
Conversation
type DefaultProps = { | ||
animated: boolean, | ||
}; | ||
type StatusBarProps = $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.
I think I'd prefer if you just named these types Props
. I believe that is consistent with all the other files
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.
Renamed it
* The background color of the status bar. | ||
* @platform android | ||
*/ | ||
backgroundColor?: ?string, |
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.
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
|}>
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.
And also re-organized these
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 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@empyrical merged commit cd1d3ce into 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 |
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
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