ReactSignedOut
Renders children only when the user is not authenticated. It reads the a_s_b cookie on the client side. No provider required and no SDK calls.
Usage
Wrap UI that should only be visible to signed-out users.
Jsx
1import { ReactSignedOut } from "@neuctra/authix";
2
3export default function Page() {
4 return (
5 <ReactSignedOut>
6 <a href="/login">Please sign in</a>
7 </ReactSignedOut>
8 );
9}Jsx
1// fallback renders when user IS authenticated
2<ReactSignedOut fallback={<p>You are already signed in.</p>}>
3 <LoginForm />
4</ReactSignedOut>Props
Configuration options for conditional rendering.
| Prop | Type | Required | Description |
|---|---|---|---|
children | ReactNode | Yes | Rendered when user is signed out. |
fallback | ReactNode | () => ReactNode | No | Rendered when user is authenticated. |
Loading Behavior
During initial cookie check, the component returns null to avoid hydration mismatch. After resolution: unauthenticated → children, authenticated → fallback.
How It Works
- Reads
a_s_bcookie (true = authenticated) - Returns null during auth resolution
- Best paired with ReactSignedIn for full control