-
Notifications
You must be signed in to change notification settings - Fork 14
fix: check win properties in browser code paths for react native #825
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: check win properties in browser code paths for react native #825
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: bb918d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6d9789a to
bb918d6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #825 +/- ##
=======================================
Coverage 67.84% 67.84%
=======================================
Files 190 190
Lines 7934 7934
Branches 1041 1041
=======================================
Hits 5383 5383
Misses 2526 2526
Partials 25 25
|

Description
This PR aims to address the issue raised here, where user is running into type errors in places accessing window properties in a react naive project.
We already check for the presence of the
windowobject in code paths meant for browser environment. However it seems that in React Native environments it's possible for window may be polyfilled and present but its properties are undefined (e.g. window.location). So in this PR we extend some of the if checks to cover the window properties we are accessing, in addition to the presence of window itself.