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

Platform.isAndroid & Platform.isIos shortcuts #9375

Closed
wants to merge 1 commit into from

Conversation

vonovak
Copy link
Collaborator

@vonovak vonovak commented Aug 12, 2016

motivation: allow to turn the Platform.OS === 'android' and Platform.OS === 'ios' into Platform.isAndroid and Platform.isIos which is shorter and well readable.

Test plan (required)
The change is simple. I tested it by modifying the UIExplorer touchables example. I can push that too, if you like.

@ghost
Copy link

ghost commented Aug 12, 2016

By analyzing the blame information on this pull request, we identified @grabbou and @dmmiller to be potential reviewers.

@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Aug 12, 2016
@brentvatne
Copy link
Collaborator

hey @vonovak! not a bad idea, my only concern here is that I don't think it belong within react-native itself. If you want to use these shortcuts you can build them easily on top of the existing Platform.OS constant. additionally, as more platforms are added to react native, we would need to include those, and these platform specific files need to be aware of the full set of platforms. eg: Platform.ios.js would need isAndroid, isWindows, isIos, isUbuntu, isOsx, etc..

for this reason, I think it is best to build a library to do this if you find it useful, or just some utility function inside of your app. 🎸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants