React 公开了一些可以在 JSX 中使用的内置组件。
¥React exposes a few built-in components that you can use in your JSX.
内置组件
¥Built-in components
-
<Fragment>
,也可以写成<>...</>
,让你可以将多个 JSX 节点组合在一起。¥
<Fragment>
, alternatively written as<>...</>
, lets you group multiple JSX nodes together. -
<Profiler>
允许你以编程方式测量 React 树的渲染性能。¥
<Profiler>
lets you measure rendering performance of a React tree programmatically. -
<Suspense>
允许你在加载子组件时显示回退。¥
<Suspense>
lets you display a fallback while the child components are loading. -
<StrictMode>
启用了额外的仅开发检查,可帮助你尽早发现错误。¥
<StrictMode>
enables extra development-only checks that help you find bugs early.
你自己的组件
¥Your own components
你还可以将 定义自己的组件 作为 JavaScript 函数。
¥You can also define your own components as JavaScript functions.