Directives

React Server Components

Directives are for use in React Server Components.

Directives provide instructions to bundlers compatible with React Server Components.


Source code directives

  • 'use client' lets you mark what code runs on the client.
  • 'use server' marks server-side functions that can be called from client-side code.

© 2013–present Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://react.dev/reference/rsc/directives