Skip to content

fix(react-best-practices): false examples to require 'use client' in react-best-practices#217

Open
Zero-1016 wants to merge 1 commit intovercel-labs:mainfrom
Zero-1016:fix/ssr-false-use-client-examples
Open

fix(react-best-practices): false examples to require 'use client' in react-best-practices#217
Zero-1016 wants to merge 1 commit intovercel-labs:mainfrom
Zero-1016:fix/ssr-false-use-client-examples

Conversation

@Zero-1016
Copy link
Copy Markdown

Summary

  • bundle-defer-third-party: Extract dynamic import with ssr: false into a separate Client Component (AnalyticsProvider) so RootLayout remains a Server Component
  • bundle-dynamic-imports: Add 'use client' directive to the component using ssr: false
  • AGENTS.md: Apply the same fixes to matching examples

Problem

ssr: false is not allowed in Server Components. The previous examples showed an incorrect pattern that would throw a Next.js runtime error when used inside RootLayout (a Server
Component).

ssr: false is not allowed with next/dynamic in Server Components. Please move it into a Client Component.

Changes

Closes #216

- bundle-defer-third-party: extract dynamic import into a separate Client Component (AnalyticsProvider) so RootLayout remains a Server Component
- bundle-dynamic-imports: add 'use client' directive to component using ssr: false
- AGENTS.md: apply same fixes to matching examples

Fixes vercel-labs#216
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 4, 2026

@Zero-1016 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-best-practices: ssr: false used without 'use client' in bundle-defer-third-party and bundle-dynamic-imports

1 participant