Skip to content

Commit

Permalink
add v6 line
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriaxyz committed Dec 2, 2024
1 parent 9981f3f commit e3a24bb
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/components/clerk-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ description: The <ClerkProvider> component wraps your React application to provi

The `<ClerkProvider>` component is required for integrating Clerk into your React application, providing session and user context to Clerk's hooks and components.

The recommended approach is to wrap your entire app with `<ClerkProvider>` at the entry point, ensuring that authentication is globally accessible. However, you can place `<ClerkProvider>` deeper in the component tree if your app has specific routes or sections that require authentication.

This flexibility allows you to implement Clerk's functionality exactly where needed without affecting the rest of your app.
The recommended approach is to wrap your entire app with `<ClerkProvider>` at the entry point, making authentication globally accessible. However, you can place `<ClerkProvider>` deeper in the component tree if your app has specific routes or areas that require authentication. This flexibility allows you to implement Clerk's functionality exactly where needed without affecting the rest of your app.

Starting with v6, `<ClerkProvider>` no longer opts your entire app into dynamic rendering by default. To enable dynamic rendering, see the [upgrade guide](/docs/upgrade-guides/nextjs/v6.mdx).

```tsx {{ filename: 'app/layout.tsx' }}
import { ClerkProvider } from '@clerk/nextjs'

export default function RootLayout({ children }) {
return (
<ClerkProvider dynamic>
<html>
<body>{children}</body>
</html>
</ClerkProvider>
)
}
```

## Usage

Expand Down

0 comments on commit e3a24bb

Please sign in to comment.