feat(nextjs): Infer the path the component is mounted at automatically in pages and app router#2634
Conversation
…y in pages and app router
🦋 Changeset detectedLatest commit: a548d58 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
| ); | ||
|
|
||
| export const SignIn = (props: SignInProps) => { | ||
| const { signInUrl } = useClerkNextOptions(); |
There was a problem hiding this comment.
I don't think we should remove the signInUrl here, this is needed if we want to keep value coming from <ClerkProvider/> or env variable NEXT_PUBLIC_CLERK_SIGN_IN_URL.
There was a problem hiding this comment.
I don't think we need to respect this - the env variable is supposed to be used so the SignIn component (and the middleware) knows where SignUp is mounted and vice versa.
You want to render the component at the path its mounted, and respecting the global value as the path means that the component will only be able to be mounted to a single route
| }; | ||
|
|
||
| export const SignUp = (props: SignUpProps) => { | ||
| const { signUpUrl } = useClerkNextOptions(); |
There was a problem hiding this comment.
The same as signInUrl applies here
…y in pages and app router (#2634) * feat(nextjs): Infer the path the component is mounted at automatically in pages and app router * Create early-cars-cross.md
Description
Detailed explanation is in the comments, please take a look at the code itself.
This PR allows using all components with path routing without passing the path manually
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore