这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@softwarebyze
Copy link
Contributor

@softwarebyze softwarebyze commented Jan 3, 2024

BackButton is only on android, so instead of checking if the platform isn't iOS, check that it isn't android

Please verify the following:

  • yarn test jest tests pass with new tests, if relevant
  • README.md has been updated with your changes, if relevant

Describe your PR

Fixes #2596

`BackButton` is only on android, so instead of checking if the platform isn't iOS, check that it isn't android
@softwarebyze
Copy link
Contributor Author

According to React Native's docs, Platform.OS should only return 'android' or 'ios'.

image

Therefore,
if (Platform.OS === "ios") return
and
if (Platform.OS !== "android") return

should be equivalent...

But it looks like on react native web, Platform.OS actually returns web? I think it makes sense and the React Native docs just need to be updated.

This looks like the real type it should be:
image

For the sake of #2596, I still think the solution of this PR is a good change.

Copy link
Contributor

@frankcalise frankcalise left a comment

Choose a reason for hiding this comment

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

Good looking out! Thanks

@frankcalise frankcalise merged commit 49818e7 into infinitered:master Jan 4, 2024
@infinitered-circleci
Copy link
Collaborator

🎉 This PR is included in version 9.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

back button error on web

3 participants