-
Notifications
You must be signed in to change notification settings - Fork 295
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(elements): Errant renders upon sign-in completion #4225
fix(elements): Errant renders upon sign-in completion #4225
Conversation
|
@@ -146,34 +144,28 @@ export default function SignInPage() { | |||
<CustomProvider provider='google'>Continue with Google</CustomProvider> | |||
</div> | |||
|
|||
{continueWithEmail ? ( |
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.
Just cleaning this up.
@@ -426,7 +410,11 @@ export const SignInRouterMachine = setup({ | |||
}, | |||
'FORM.ATTACH': { | |||
description: 'Attach/re-attach the form to the router.', | |||
actions: enqueueActions(({ enqueue, event }) => { | |||
actions: enqueueActions(({ context, enqueue, event }) => { |
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.
Ensuring we don't attach a new formRef, and ultimately re-render, if it's not necessary.
enqueue.raise({ type: 'NEXT', resource: event.output }); | ||
}), | ||
resetResource: assign({ resource: ({ context }) => context.clerk.client.signIn }), | ||
setResource: assign({ |
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.
Rely on the returned SIA resource, over client.signIn
@@ -1,5 +1,5 @@ | |||
import { useClerk } from '@clerk/shared/react'; | |||
import { useClerkHostRouter } from '@clerk/shared/router'; | |||
import { useClerkHostRouter, useClerkRouter } from '@clerk/shared/router'; |
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.
Use useClerkRouter
hook from shared vs the original local implementation.
}, [clerk, exampleMode, formRef?.id, !!router, clerk.loaded]); | ||
}, [Boolean(clerk), exampleMode, !!router, clerk.loaded]); | ||
|
||
useEffect(() => { |
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.
Limit the number of events sent by scoping the dependencies down.
c4550eb
to
2709db7
Compare
868e94b
to
874f4e2
Compare
2709db7
to
4e0f396
Compare
874f4e2
to
ab1b18c
Compare
4e0f396
to
6520328
Compare
ab1b18c
to
aa8e5f7
Compare
4dafbc6
to
ff29b34
Compare
Description
TODO
Fixes SDKI-144
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change