@@ -59,6 +59,8 @@ export default function ClientComponentExample() {
...
@@ -59,6 +59,8 @@ export default function ClientComponentExample() {
When using `React.lazy()` and Suspense, Client Components will be pre-rendered (SSR) by default.
When using `React.lazy()` and Suspense, Client Components will be pre-rendered (SSR) by default.
> **Note:** `ssr: false` option will only work for client components, move it into client components ensure the client code-splitting working properly.
If you want to disable pre-rendering for a Client Component, you can use the `ssr` option set to `false`:
If you want to disable pre-rendering for a Client Component, you can use the `ssr` option set to `false`:
If you dynamically import a Server Component, only the Client Components that are children of the Server Component will be lazy-loaded - not the Server Component itself.
If you dynamically import a Server Component, only the Client Components that are children of the Server Component will be lazy-loaded - not the Server Component itself.
It will also help preload the static assets such as CSS when you're using it in Server Components.
> **Note:** `ssr: false` option is not supported in Server Components.
To dynamically load a component on the client side, you can use the `ssr` option to disable server-rendering. This is useful if an external dependency or component relies on browser APIs like `window`.
To dynamically load a component on the client side, you can use the `ssr` option to disable server-rendering. This is useful if an external dependency or component relies on browser APIs like `window`.