diff --git a/src/content/reference/react-dom/components/link.md b/src/content/reference/react-dom/components/link.md index 5381608486..c1fabfc800 100644 --- a/src/content/reference/react-dom/components/link.md +++ b/src/content/reference/react-dom/components/link.md @@ -80,11 +80,7 @@ React 对 `` 的扩展当前仅在 React Canary 与 experimental 渠道中 #### 特殊的渲染行为 {/*special-rendering-behavior*/} -<<<<<<< HEAD 无论 `` 组件在 React 树中的哪个位置被渲染,React 都会始终将其对应的 DOM 元素放在文档的 `
` 中。`` 是 `` 在 DOM 中唯一有效的位置,但如果表示特定页面的组件可以自行渲染 `` 组件,则这种做法既方便又保持了可组合性。 -======= -React will always place the DOM element corresponding to the `` component within the document’s ``, regardless of where in the React tree it is rendered. The `` is the only valid place for `` to exist within the DOM, yet it’s convenient and keeps things composable if a component representing a specific page can render `` components itself. ->>>>>>> 1a839ff74e40f40a1a8ea6ae1d4837b68696550c 但是,有几个例外情况: @@ -96,13 +92,8 @@ React will always place the DOM element corresponding to the `` component 此外,如果 `` 指向的是样式表(即,在其属性中具有 `rel="stylesheet"`),React 会以以下方式对其进行特殊处理: -<<<<<<< HEAD -* 渲染 `` 的组件将在样式表加载时进行 [挂起](http://localhost:3000/reference/react/Suspense)。 +* 渲染 `` 的组件将在样式表加载时进行 [挂起](/reference/react/Suspense)。 * 如果多个组件渲染指向相同样式表的链接,React 将对它们进行去重,并只将单个链接放入 DOM 中。如果两个链接具有相同的 `href` 属性,则认为它们是相同的。 -======= -* The component that renders `` will [suspend](/reference/react/Suspense) while the stylesheet is loading. -* If multiple components render links to the same stylesheet, React will de-duplicate them and only put a single link into the DOM. Two links are considered the same if they have the same `href` prop. ->>>>>>> 1a839ff74e40f40a1a8ea6ae1d4837b68696550c 但是,有两个例外情况: @@ -143,11 +134,7 @@ export default function BlogPage() { ### 链接到样式表 {/*linking-to-a-stylesheet*/} -<<<<<<< HEAD -如果一个组件依赖于某个样式表以正确显示,可以在组件内部渲染一个指向该样式表的链接。当样式表加载时,组件将会 [挂起](http://localhost:3000/reference/react/Suspense)。因此必须提供 `precedence` 属性,该属性告诉 React 将此样式表放置在其他样式表的何处——具有较高优先级的样式表可以覆盖较低优先级的样式表。 -======= -If a component depends on a certain stylesheet in order to be displayed correctly, you can render a link to that stylesheet within the component. Your component will [suspend](/reference/react/Suspense) while the stylesheet is loading. You must supply the `precedence` prop, which tells React where to place this stylesheet relative to others — stylesheets with higher precedence can override those with lower precedence. ->>>>>>> 1a839ff74e40f40a1a8ea6ae1d4837b68696550c +如果一个组件依赖于某个样式表以正确显示,可以在组件内部渲染一个指向该样式表的链接。当样式表加载时,组件将会 [挂起](/reference/react/Suspense)。因此必须提供 `precedence` 属性,该属性告诉 React 将此样式表放置在其他样式表的何处——具有较高优先级的样式表可以覆盖较低优先级的样式表。