Directives - This feature is available in the latest Canary

Canary

ה-directives האלה נדרשים רק אם אתם משתמשים ב-React Server Components או בונים ספרייה שתואמת אליהם.

Directives מספקים הנחיות ל-bundlers שתואמים ל-React Server Components.


Directives בקוד מקור

  • 'use client' מאפשר לסמן איזה קוד רץ בצד לקוח.
  • 'use server' מסמן פונקציות צד שרת שאפשר לקרוא להן מקוד צד לקוח.