<SignedIn>
Overview
The <SignedIn>
component offers authentication checks as a cross-cutting concern. Any children components wrapped by a <SignedIn>
component will be rendered only if there's a User with an active Session signed in your application.
import React from 'react'
import { ClerkProvider, SignedIn } from '@clerk/nextjs'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<ClerkProvider>
<html lang="en">
<body>
<header>
<SignedIn>
<div>You are signed in</div>
</SignedIn>
<p>This content is always visible.</p>
</header>
{children}
</body>
</html>
</ClerkProvider>
)
}
Feedback
Last updated on