Skip to content

Commit 6daa5f9

Browse files
panteliselefwobsoriano
authored andcommitted
chore(nextjs,tanstack-start,remix): Drop path routing requirement for CreateOrganization (#4687)
1 parent e6f1f1f commit 6daa5f9

File tree

5 files changed

+12
-39
lines changed

5 files changed

+12
-39
lines changed

.changeset/many-ads-move.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/tanstack-start': minor
3+
'@clerk/nextjs': minor
4+
'@clerk/remix': minor
5+
---
6+
7+
Drop path routing requirement for `<CreateOrganization/>`.

packages/nextjs/src/client-boundary/uiComponents.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
'use client';
22

33
import {
4-
CreateOrganization as BaseCreateOrganization,
54
OrganizationProfile as BaseOrganizationProfile,
65
SignIn as BaseSignIn,
76
SignUp as BaseSignUp,
87
UserProfile as BaseUserProfile,
98
} from '@clerk/clerk-react';
10-
import type {
11-
CreateOrganizationProps,
12-
OrganizationProfileProps,
13-
SignInProps,
14-
SignUpProps,
15-
UserProfileProps,
16-
} from '@clerk/types';
9+
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
1710
import React from 'react';
1811

1912
import { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps';
2013

2114
export {
15+
CreateOrganization,
2216
OrganizationList,
2317
OrganizationSwitcher,
2418
SignInButton,
@@ -41,10 +35,6 @@ export const UserProfile: typeof BaseUserProfile = Object.assign(
4135
{ ...BaseUserProfile },
4236
);
4337

44-
export const CreateOrganization = (props: CreateOrganizationProps) => {
45-
return <BaseCreateOrganization {...useEnforceCorrectRoutingProps('CreateOrganization', props)} />;
46-
};
47-
4838
// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
4939
// to support the CustomPage functionality (eg OrganizationProfile.Page)
5040
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:

packages/remix/src/client/uiComponents.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import {
2-
CreateOrganization as BaseCreateOrganization,
32
OrganizationProfile as BaseOrganizationProfile,
43
SignIn as BaseSignIn,
54
SignUp as BaseSignUp,
65
UserProfile as BaseUserProfile,
76
} from '@clerk/clerk-react';
87
import { useRoutingProps } from '@clerk/clerk-react/internal';
9-
import type {
10-
CreateOrganizationProps,
11-
OrganizationProfileProps,
12-
SignInProps,
13-
SignUpProps,
14-
UserProfileProps,
15-
} from '@clerk/types';
8+
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
169
import React from 'react';
1710

1811
import { usePathnameWithoutSplatRouteParams } from './usePathnameWithoutSplatRouteParams';
@@ -29,11 +22,6 @@ export const UserProfile: typeof BaseUserProfile = Object.assign(
2922
{ ...BaseUserProfile },
3023
);
3124

32-
export const CreateOrganization = (props: CreateOrganizationProps) => {
33-
const path = usePathnameWithoutSplatRouteParams();
34-
return <BaseCreateOrganization {...useRoutingProps('CreateOrganization', props, { path })} />;
35-
};
36-
3725
// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
3826
// to support the CustomPage functionality (eg OrganizationProfile.Page)
3927
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './ClerkProvider';
2-
export { SignIn, SignUp, OrganizationProfile, OrganizationList, CreateOrganization, UserProfile } from './uiComponents';
2+
export { SignIn, SignUp, OrganizationProfile, OrganizationList, UserProfile } from './uiComponents';

packages/tanstack-start/src/client/uiComponents.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import {
2-
CreateOrganization as BaseCreateOrganization,
32
OrganizationList as BaseOrganizationList,
43
OrganizationProfile as BaseOrganizationProfile,
54
SignIn as BaseSignIn,
65
SignUp as BaseSignUp,
76
UserProfile as BaseUserProfile,
87
} from '@clerk/clerk-react';
98
import { useRoutingProps } from '@clerk/clerk-react/internal';
10-
import type {
11-
CreateOrganizationProps,
12-
OrganizationProfileProps,
13-
SignInProps,
14-
SignUpProps,
15-
UserProfileProps,
16-
} from '@clerk/types';
9+
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
1710
import { useLocation, useParams } from '@tanstack/react-router';
1811

1912
const usePathnameWithoutSplatRouteParams = () => {
@@ -46,11 +39,6 @@ export const UserProfile: typeof BaseUserProfile = Object.assign(
4639
{ ...BaseUserProfile },
4740
);
4841

49-
export const CreateOrganization = (props: CreateOrganizationProps) => {
50-
const path = usePathnameWithoutSplatRouteParams();
51-
return <BaseCreateOrganization {...useRoutingProps('CreateOrganization', props, { path })} />;
52-
};
53-
5442
// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
5543
// to support the CustomPage functionality (eg OrganizationProfile.Page)
5644
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:

0 commit comments

Comments
 (0)