Skip to main content

<LoggedOut>

<LoggedOut> is a conditional rendering helper. Use this component where content should only be shown to a user who has not yet logged in.

The children of <LoggedOut> will be shown only once the SDK is ready and the user is logged out.

Usage

Displaying content for logged out users only.

import { LoggedOut } from "@slashid/react"

function PublicComponent() {
return <LoggedOut>Only visible for un-authenticated users.</LoggedOut>
}

With a fallback during SDK initialisation

Using the <SlashIDLoaded> component to render a fallback during SDK initialisation.

import { LoggedOut, SlashIDLoaded } from "@slashid/react"
import { Loading } from "..."

function PublicComponentWithLoadingState() {
return (
<SlashIDLoaded fallback={<Loading />}>
<LoggedOut>
Only visible for un-authenticated users.
</LoggedOut>
</SlashIDLoaded>
)
}

Props

<LoggedOut> has no props.