Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clean-rivers-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fixes an issue during sign-up flow where a user lands on the continue step, and proceeds successfully through the sign-up process and gets redirected to AP sign-up due to signUp.id being undefined.
Copy link
Member

Choose a reason for hiding this comment

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

i'm a bit confused by this. I don't see how the useEffect solves the issue.

could you post a before/after video of the interactions ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here is the issue currently present.

Screen.Recording.2024-12-04.at.1.14.03.PM.mov

Copy link
Member Author

Choose a reason for hiding this comment

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

The SignUpContinue component seems to be rerendering causing signup.id to be undefined which triggers the navigation to AP. Chatting with @brkalow it seems to stem from onBeforeSetActive causing the component to re-render.

Copy link
Member Author

Choose a reason for hiding this comment

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

@panteliselef added before/after to description

Copy link
Member

Choose a reason for hiding this comment

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

thanks for providing these, i appreciate it. I can see how onBeforeSetActive could affect things

12 changes: 9 additions & 3 deletions packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useClerk } from '@clerk/shared/react';
import React, { useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';

import { useCoreSignUp, useEnvironment, useSignUpContext } from '../../contexts';
import { descriptors, Flex, Flow, localizationKeys } from '../../customizables';
Expand Down Expand Up @@ -84,9 +84,15 @@ function _SignUpContinue() {
[signUp.missingFields],
);

// Redirect to sign-up if there is no persisted sign-up
useEffect(() => {
// Redirect to sign-up if there is no persisted sign-up
if (!signUp.id) {
void navigate(displayConfig.signUpUrl);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

if (!signUp.id) {
void navigate(displayConfig.signUpUrl);
return <LoadingCard />;
}

Expand Down
Loading