Uh oh!
There was an error while loading. Please reload this page.
feat(elements): Complete and Reset Updates - #3343
Conversation
🦋 Changeset detectedLatest commit: 1978150 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
532bd7c to
377ba9eCompare| // TODO: eventually we'll rely on the framework SDK to specify its host router, but for now we'll default to Next.js | ||
| const router = useNextRouter(); | ||
| const isRootPath = path === router.pathname(); |
There was a problem hiding this comment.
This is required, on both Sign Up and Sign In, otherwise, in the case of callbacks, the fallback will show regardless.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
299e17c to
f46886fComparef46886f to
7e74b27Comparecomplete step to Sign Up and Sign In.* fix(elements): Follow-on machine initialization [SDK-1746] * chore(elements): Add changeset * chore(elements): Remove unnecessary TS comment * chore(elements): Add line item to changeset
| }, [clerk, exampleMode, formRef, router]); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [clerk, exampleMode, formRef?.id, !!router]); |
There was a problem hiding this comment.
I saw that formRef and router were causing many unnecessary re-renders. I narrowed the checks down here and in sign up to optimize.
| return () => { | ||
| if (factorCtx) { | ||
| if (factorCtx?.getSnapshot().status === 'active') { |
There was a problem hiding this comment.
Ensure we only run this event on an active machine.
Description
This PR contains the results of multiple similar PRs. As-such, this PR ensures the following:
STRATEGY.UNREGISTERevent from being called on stopped machines.xstatetov5.13.0Fixes SDK-1745
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change