Skip to main content

SignedIn

Conditionally renders its children only when a user is authenticated. Returns null during loading or if no active session exists.
import { SignedIn } from "@wacht/react-router";

export default function Dashboard() {
  return (
    <SignedIn>
      <h1>Welcome!</h1>
      <p>This content is only visible to signed-in users.</p>
    </SignedIn>
  );
}

Protected Route

import { SignedIn, NavigateToSignIn } from "@wacht/react-router";

export default function ProtectedPage() {
  return (
    <>
      <SignedIn>
        <ProtectedContent />
      </SignedIn>
      <NavigateToSignIn />
    </>
  );
}

Params

children
ReactNode
Content to render when signed in.