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

Fix ReferenceError: React is not defined #212

Merged
merged 1 commit into from
Sep 1, 2021
Merged

Fix ReferenceError: React is not defined #212

merged 1 commit into from
Sep 1, 2021

Conversation

rijk
Copy link
Contributor

@rijk rijk commented Sep 1, 2021

Summary

When adding the mock to my Jest setup file following the instructions in the documentation, I get the following error when running my tests:

    ReferenceError: React is not defined

      at Component (node_modules/react-native-safe-area-context/jest/mock.js:23:5)
      at renderWithHooks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6016:18)
  

Test Plan

This change makes the tests pass.

Copy link
Collaborator

@janicduplessis janicduplessis left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! I think it was working when I tested it because I’m using the new jsx transform that doesn’t require importing React. This will make it work in both case.

@janicduplessis janicduplessis merged commit 111febb into AppAndFlow:main Sep 1, 2021
@rijk rijk deleted the patch-1 branch September 1, 2021 15:55
@rijk
Copy link
Contributor Author

rijk commented Sep 1, 2021

Aah, that makes sense. Thanks!

@janicduplessis
Copy link
Collaborator

published as 3.3.2

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.

2 participants