<SlashIDLoaded>
<SlashIDLoaded>
is a conditional rendering helper. It acts as a guard for SlashID core SDK dependent operations. Use this component where you need to know with confidence that the SlashID core SDK has finished its initialisation, accurate information about the user is available, and the React SDK is ready to go.
The children
of <SlashIDLoaded>
will be shown once SDK initialisation is complete.
Usage
import { SlashIDLoaded } from "@slashid/react"
export default function Component() {
return (
<SlashIDLoaded>
SlashID is ready!
</SlashIDLoaded>
);
}
With fallback
import { SlashIDLoaded, LoggedOut } from "@slashid/react"
import { Loading } from "..."
export default function Component() {
return (
<SlashIDLoaded fallback={<Loading text="Please wait..." />}>
<LoggedOut>Please log in</LoggedOut>
</SlashIDLoaded>
)
}
Props
name | type | default | description |
---|---|---|---|
fallback? | React.ReactNode | The content shown during SDK initialisation |