Skip to content

Commit

Permalink
chore(nextjs,tanstack-start,remix): Drop path routing requirement for…
Browse files Browse the repository at this point in the history
… CreateOrganization (#4687)
  • Loading branch information
panteliselef authored and wobsoriano committed Feb 8, 2025
1 parent e6f1f1f commit 6daa5f9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 39 deletions.
7 changes: 7 additions & 0 deletions .changeset/many-ads-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/tanstack-start': minor
'@clerk/nextjs': minor
'@clerk/remix': minor
---

Drop path routing requirement for `<CreateOrganization/>`.
14 changes: 2 additions & 12 deletions packages/nextjs/src/client-boundary/uiComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
'use client';

import {
CreateOrganization as BaseCreateOrganization,
OrganizationProfile as BaseOrganizationProfile,
SignIn as BaseSignIn,
SignUp as BaseSignUp,
UserProfile as BaseUserProfile,
} from '@clerk/clerk-react';
import type {
CreateOrganizationProps,
OrganizationProfileProps,
SignInProps,
SignUpProps,
UserProfileProps,
} from '@clerk/types';
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
import React from 'react';

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

export {
CreateOrganization,
OrganizationList,
OrganizationSwitcher,
SignInButton,
Expand All @@ -41,10 +35,6 @@ export const UserProfile: typeof BaseUserProfile = Object.assign(
{ ...BaseUserProfile },
);

export const CreateOrganization = (props: CreateOrganizationProps) => {
return <BaseCreateOrganization {...useEnforceCorrectRoutingProps('CreateOrganization', props)} />;
};

// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
// to support the CustomPage functionality (eg OrganizationProfile.Page)
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:
Expand Down
14 changes: 1 addition & 13 deletions packages/remix/src/client/uiComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import {
CreateOrganization as BaseCreateOrganization,
OrganizationProfile as BaseOrganizationProfile,
SignIn as BaseSignIn,
SignUp as BaseSignUp,
UserProfile as BaseUserProfile,
} from '@clerk/clerk-react';
import { useRoutingProps } from '@clerk/clerk-react/internal';
import type {
CreateOrganizationProps,
OrganizationProfileProps,
SignInProps,
SignUpProps,
UserProfileProps,
} from '@clerk/types';
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
import React from 'react';

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

export const CreateOrganization = (props: CreateOrganizationProps) => {
const path = usePathnameWithoutSplatRouteParams();
return <BaseCreateOrganization {...useRoutingProps('CreateOrganization', props, { path })} />;
};

// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
// to support the CustomPage functionality (eg OrganizationProfile.Page)
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:
Expand Down
2 changes: 1 addition & 1 deletion packages/tanstack-start/src/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './ClerkProvider';
export { SignIn, SignUp, OrganizationProfile, OrganizationList, CreateOrganization, UserProfile } from './uiComponents';
export { SignIn, SignUp, OrganizationProfile, OrganizationList, UserProfile } from './uiComponents';
14 changes: 1 addition & 13 deletions packages/tanstack-start/src/client/uiComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import {
CreateOrganization as BaseCreateOrganization,
OrganizationList as BaseOrganizationList,
OrganizationProfile as BaseOrganizationProfile,
SignIn as BaseSignIn,
SignUp as BaseSignUp,
UserProfile as BaseUserProfile,
} from '@clerk/clerk-react';
import { useRoutingProps } from '@clerk/clerk-react/internal';
import type {
CreateOrganizationProps,
OrganizationProfileProps,
SignInProps,
SignUpProps,
UserProfileProps,
} from '@clerk/types';
import type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/types';
import { useLocation, useParams } from '@tanstack/react-router';

const usePathnameWithoutSplatRouteParams = () => {
Expand Down Expand Up @@ -46,11 +39,6 @@ export const UserProfile: typeof BaseUserProfile = Object.assign(
{ ...BaseUserProfile },
);

export const CreateOrganization = (props: CreateOrganizationProps) => {
const path = usePathnameWithoutSplatRouteParams();
return <BaseCreateOrganization {...useRoutingProps('CreateOrganization', props, { path })} />;
};

// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
// to support the CustomPage functionality (eg OrganizationProfile.Page)
// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:
Expand Down

0 comments on commit 6daa5f9

Please sign in to comment.