Skip to main content

SignedInWhenLoaded

Function SignedInWhenLoaded 

Source
pub fn SignedInWhenLoaded(_: SignedInWhenLoadedProps) -> Element
Expand description

Render children only after clerk-js has loaded and auth resolved to signed in.

The loading-aware counterpart to SignedIn, mirroring crate::SignedOutWhenLoaded. This is useful in fullstack/SSR apps that render before clerk-js has finished resolving the browser session: use fallback for the interim (for example an avatar skeleton) and render crate::ClerkFailed or crate::use_clerk_error nearby for failures.

§Example

use dioxus::prelude::*;
use dioxus_clerk::*;

#[component]
fn AccountNav() -> Element {
    rsx! {
        SignedInWhenLoaded {
            fallback: rsx! { span { "Checking auth..." } },
            UserButton {}
        }
    }
}

§Props

For details, see the props struct definition.