Directives - This feature is available in the latest Canary

Canary

These directives are needed only if you’re using React Server Components or building a library compatible with them.

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.