-
Notifications
You must be signed in to change notification settings - Fork 245
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(clerk-js): Fix unsafe window.addEventListener() call #3097
Conversation
…n-browser environments
🦋 Changeset detectedLatest commit: e53143b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
!snapshot |
Hey @BRKalow - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i [email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
@@ -722,16 +722,16 @@ export class Clerk implements ClerkInterface { | |||
// undefined, then wait for beforeEmit to complete before emitting the new session. | |||
// When undefined, neither SignedIn nor SignedOut renders, which avoids flickers or | |||
// automatic reloading when reloading shouldn't be happening. | |||
const beforeUnloadTracker = createBeforeUnloadTracker(); | |||
const beforeUnloadTracker = this.#options.standardBrowser ? createBeforeUnloadTracker() : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, have the factory function accept an argument to indicate whether or not it's a web browser environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Description
Fixes a customer-reported issue where we were attempting to call
window.addEventListener()
via our Expo SDK.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change