Rendering
RSC composition through children
A server parent may pass a React element as children to a Client Component; the client wrapper controls where to display it without importing the server child. This is composition, not secrecy. The example defines the wrapper only; compose it in a server page with a public child. Source: https://nextjs.org/docs/app/getting-started/server-and-client-components. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Formal Syntax & Structure
nextjs syntaxnextjs
<ClientWrapper><ServerChild /></ClientWrapper>Working Example
Example Snippetnextjs
'use client';import {useState,type ReactNode} from 'react';export default function Reveal({children}:{children:ReactNode}){const [open,setOpen]=useState(false);return <section><button aria-expanded={open} onClick={()=>setOpen(!open)}>Details</button>{open?children:null}</section>;}