加入我们,参加 5 月 15-16 日的 React 大会。
了解更多。
React
学习
参考
社区
博客

    react@18.2.0

  • 概述
  • Hooks
    • use - This feature is available in the latest Canary 框架
    • useCallback
    • useContext
    • useDebugValue
    • useDeferredValue
    • useEffect
    • useId
    • useImperativeHandle
    • useInsertionEffect
    • useLayoutEffect
    • useMemo
    • useOptimistic - This feature is available in the latest Canary 框架
    • useReducer
    • useRef
    • useState
    • useSyncExternalStore
    • useTransition
  • 组件
    • <Fragment> (<>)
    • <Profiler>
    • <StrictMode>
    • <Suspense>
  • API
    • cache - This feature is available in the latest Canary 框架
    • createContext
    • forwardRef
    • lazy
    • memo
    • startTransition
    • experimental_taintObjectReference - This feature is available in the latest Canary 框架
    • experimental_taintUniqueValue - This feature is available in the latest Canary 框架
  • 指令 - This feature is available in the latest Canary 框架
    • 'use client' - This feature is available in the latest Canary 框架
    • 'use server' - This feature is available in the latest Canary 框架
  • react-dom@18.2.0

  • Hooks
    • useFormState - This feature is available in the latest Canary 框架
    • useFormStatus - This feature is available in the latest Canary 框架
  • 组件
    • 通用(例如 <div>)
    • <form> - This feature is available in the latest Canary 框架
    • <input>
    • <option>
    • <progress>
    • <select>
    • <textarea>
    • <link> - This feature is available in the latest Canary 框架
    • <meta> - This feature is available in the latest Canary 框架
    • <script> - This feature is available in the latest Canary 框架
    • <style> - This feature is available in the latest Canary 框架
    • <title> - This feature is available in the latest Canary 框架
  • API
    • createPortal
    • flushSync
    • findDOMNode
    • hydrate
    • preconnect - This feature is available in the latest Canary 框架
    • prefetchDNS - This feature is available in the latest Canary 框架
    • preinit - This feature is available in the latest Canary 框架
    • preinitModule - This feature is available in the latest Canary 框架
    • preload - This feature is available in the latest Canary 框架
    • preloadModule - This feature is available in the latest Canary 框架
    • render
    • unmountComponentAtNode
  • 客户端 API
    • createRoot
    • hydrateRoot
  • 服务器 API
    • renderToNodeStream
    • renderToPipeableStream
    • renderToReadableStream
    • renderToStaticMarkup
    • renderToStaticNodeStream
    • renderToString
  • React 规则

  • 概述
  • 组件和 Hooks 必须是纯净的
  • React 调用组件和 Hooks
  • Hooks 规则
  • 遗留 API

  • 遗留 React API
    • 子节点
    • cloneElement
    • 组件
    • createElement
    • createFactory
    • createRef
    • isValidElement
    • PureComponent

此页面有用吗?

API 参考

指令 - This feature is available in the latest Canary 框架

Canary

只有在您使用 React 服务器组件或构建与它们兼容的库时,才需要这些指令。

指令为与 React 服务器组件兼容的捆绑器提供说明。


源代码指令

  • 'use client' 允许您标记在客户端运行的代码。
  • 'use server' 标记可以从客户端代码调用的服务器端函数。
Previousexperimental_taintUniqueValue
Next'use client'

你觉得这些文档怎么样?

参加我们的调查!

©2024
学习 React
快速入门
安装
描述 UI
添加交互性
管理状态
逃生舱
API 参考
React API
React DOM API
社区
行为准则
认识团队
文档贡献者
致谢
更多
博客
React Native
隐私
条款

本页内容

  • 概述
  • 源代码指令