Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cute-hats-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/shared": patch
---

Fix Stripe elements not loading by removing the `billingEnabled` gate from `useStripeClerkLibs`
4 changes: 0 additions & 4 deletions packages/shared/src/react/billing/useStripeClerkLibs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { loadStripe } from '@stripe/stripe-js';

import { defineKeepPreviousDataFn } from '../clerk-rq/keep-previous-data';
import { useClerkQuery } from '../clerk-rq/useQuery';
import { useBillingHookEnabled } from '../hooks/useBillingHookEnabled';
import { useClerk } from '../hooks/useClerk';

type LoadStripeFn = typeof loadStripe;
Expand All @@ -19,15 +18,12 @@ export type UseStripeClerkLibsResult = StripeClerkLibs | null;
function useStripeClerkLibs(): UseStripeClerkLibsResult {
const clerk = useClerk();

const billingEnabled = useBillingHookEnabled();

const query = useClerkQuery({
queryKey: ['clerk-stripe-sdk'],
queryFn: async () => {
const loadStripe = (await clerk.__internal_loadStripeJs()) as LoadStripeFn;
return { loadStripe };
},
enabled: billingEnabled,
staleTime: Infinity,
refetchOnWindowFocus: false,
placeholderData: defineKeepPreviousDataFn(true),
Expand Down
Loading