diff --git a/.changeset/olive-zebras-arrive.md b/.changeset/olive-zebras-arrive.md new file mode 100644 index 00000000000..c06549bf4b7 --- /dev/null +++ b/.changeset/olive-zebras-arrive.md @@ -0,0 +1,10 @@ +--- +'@clerk/clerk-react': patch +'@clerk/vue': patch +--- + +Add deprecation notices for the following components: + +- `RedirectToUserProfile` +- `RedirectToOrganizationProfile` +- `RedirectToCreateOrganization` diff --git a/packages/react/src/components/controlComponents.tsx b/packages/react/src/components/controlComponents.tsx index 2bfa02362e7..0b54363fc38 100644 --- a/packages/react/src/components/controlComponents.tsx +++ b/packages/react/src/components/controlComponents.tsx @@ -1,3 +1,4 @@ +import { deprecated } from '@clerk/shared/deprecated'; import type { CheckAuthorizationWithCustomPermissions, HandleOAuthCallbackParams, @@ -164,24 +165,36 @@ export const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp { React.useEffect(() => { + deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.'); void clerk.redirectToUserProfile(); }, []); return null; }, 'RedirectToUserProfile'); +/** + * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-organization-profile) instead, will be removed in the next major version. + */ export const RedirectToOrganizationProfile = withClerk(({ clerk }) => { React.useEffect(() => { + deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.'); void clerk.redirectToOrganizationProfile(); }, []); return null; }, 'RedirectToOrganizationProfile'); +/** + * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-create-organization) instead, will be removed in the next major version. + */ export const RedirectToCreateOrganization = withClerk(({ clerk }) => { React.useEffect(() => { + deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.'); void clerk.redirectToCreateOrganization(); }, []); diff --git a/packages/vue/src/components/controlComponents.ts b/packages/vue/src/components/controlComponents.ts index 8b6eee4d0d5..20d99e2d40c 100644 --- a/packages/vue/src/components/controlComponents.ts +++ b/packages/vue/src/components/controlComponents.ts @@ -1,3 +1,4 @@ +import { deprecated } from '@clerk/shared/deprecated'; import type { CheckAuthorizationWithCustomPermissions, HandleOAuthCallbackParams as HandleOAuthCallbackParamsOriginal, @@ -60,24 +61,36 @@ export const RedirectToSignUp = defineComponent((props: RedirectOptions) => { return () => null; }); +/** + * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-user-profile) instead, will be removed in the next major version. + */ export const RedirectToUserProfile = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.'); void clerk.redirectToUserProfile(); }); return () => null; }); +/** + * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-organization-profile) instead, will be removed in the next major version. + */ export const RedirectToOrganizationProfile = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.'); void clerk.redirectToOrganizationProfile(); }); return () => null; }); +/** + * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-create-organization) instead, will be removed in the next major version. + */ export const RedirectToCreateOrganization = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.'); void clerk.redirectToCreateOrganization(); });