diff --git a/packages/react/src/components/withClerk.tsx b/packages/react/src/components/withClerk.tsx index a78a1c82c8..b826b6494a 100644 --- a/packages/react/src/components/withClerk.tsx +++ b/packages/react/src/components/withClerk.tsx @@ -2,8 +2,6 @@ import type { LoadedClerk, Without } from '@clerk/types'; import React from 'react'; import { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext'; -import { errorThrower } from '../errors/errorThrower'; -import { hocChildrenNotAFunctionError } from '../errors/messages'; import { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider'; export const withClerk =

( @@ -37,19 +35,3 @@ export const withClerk =

( HOC.displayName = `withClerk(${displayName})`; return HOC; }; - -export const WithClerk: React.FC<{ - children: (clerk: LoadedClerk) => React.ReactNode; -}> = ({ children }) => { - const clerk = useIsomorphicClerkContext(); - - if (typeof children !== 'function') { - errorThrower.throw(hocChildrenNotAFunctionError); - } - - if (!clerk.loaded) { - return null; - } - - return <>{children(clerk as unknown as LoadedClerk)}; -}; diff --git a/packages/react/src/errors/messages.ts b/packages/react/src/errors/messages.ts index 359850c397..e63ce6979a 100644 --- a/packages/react/src/errors/messages.ts +++ b/packages/react/src/errors/messages.ts @@ -3,8 +3,6 @@ export const noClerkProviderError = 'You must wrap your application in a `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;