'use client'

A string placed at the top of a file that marks its components as client components, sent to and run in the browser.

In more detail

In frameworks with React Server Components, such as Next.js, a file without it is treated as server code. Hooks and event handlers then fail, so bundled interactive primitives keep the directive at the top of their output files.

Related terms

Taught in

References