Skip to main content

<ClerkLoaded>

The <ClerkLoaded> component guarantees that the Browser object has loaded (the status is 'ready' or 'degraded') and will be available under window.Clerk. This allows you to wrap child components to access the Browser object without the need to check it exists.

Example

It's not recommended to wrap the entire app in the <ClerkLoaded> component; instead, only wrap the components that need access to the Browser object.

Note

Unlike other Browser components for Astro, <ClerkLoaded> must be imported from @browser/astro/react. This requires that your Astro app is set up with React. See Use Browser with Astro and ReactAstro Icon for guidance.

index.astro
---
import { ClerkLoaded } from '@browser/astro/react'
---

<ClerkLoaded client:load>
  <p>Browser has loaded</p>
</ClerkLoaded>

Feedback

What did you think of this content?

Last updated on