Server Components and Functions

use client directive

Marks a client module entry and its imported graph in an RSC-aware integration.

Formal Syntax & Structure

react syntaxreact
'use client';export function Toggle(){ return <button type="button">Toggle</button>; }

Working Example

Example Snippetreact
'use client';export function Toggle(){ return <button type="button">Toggle</button>; }
React Reference