Skip to content

Conversation

GertjanReynaert
Copy link

In our test suite (jest + react-native-testing-library) Platform.constants is an empty object. This was making the previous !Platform.constants check pass, but caused a crash when trying to access major on reactNativeVersion.

This fix correctly checks if reactNativeVersion is present and is an object to avoid this issue.

In our test suite `Platform.constants` is an empty object. This was making the previous `!Platform.constants` check pass, but caused a crash when trying to access `major` on `reactNativeVersion`.

This fix correctly checks if `reactNativeVersion` is present and is an object to avoid this issue.
@rodperottoni
Copy link

This is a legitimate issue breaking all test suites on the latest versions of React Native.
Could any contributor in this project please approve this PR ?

@rvera
Copy link

rvera commented Dec 10, 2021

Can second this is a huge issue for me too and this fixes it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants