指令向 与 React 服务器组件兼容的打包器 提供指令。
¥Directives provide instructions to bundlers compatible with React Server Components.
源代码指令
¥Source code directives
-
'use client'
允许你标记客户端上运行的代码。¥
'use client'
lets you mark what code runs on the client. -
'use server'
标记可以从客户端代码调用的服务器端函数。¥
'use server'
marks server-side functions that can be called from client-side code.