SignedIn, SignedOut
The SignedIn
component renders if the user is signed in, while the SignedOut
component renders if the user is signed out.
import { SignedIn, SignedOut } from "@clerk/clerk-react";
const SignInStatus = () => (
<div>
<SignedIn>The user is signed in.</SignedIn>
<SignedOut>The user is signed out.</SignedOut>
</div>
);
More precisely, these components reference the session
property on the Clerk
context to determine whether to render.
- When
session
is a Session object, theSignedIn
component will render. - When
session
isnull
, theSignedOut
component will render. - When
session
isundefined
, neither component will render. This indicates that Clerk is still loading or thatsession
is in the process of changing.