Skip to content

Commit 487d982

Browse files
authored
fix conflict
1 parent 4f098c8 commit 487d982

File tree

3 files changed

+5
-44
lines changed

3 files changed

+5
-44
lines changed

src/content/blog/2025/02/14/sunsetting-create-react-app.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,9 @@ This error message will only be shown once per install.
6565

6666
针对现有应用,以下指南将协助你迁移至构建工具:
6767

68-
<<<<<<< HEAD
6968
* [Create React App 到 Vite 迁移指南](https://www.robinwieruch.de/vite-create-react-app/)
70-
* [Create React App 到 Parcel 迁移指南](https://stackoverflow.com/a/49605484)
69+
* [Create React App 到 Parcel 迁移指南](https://parceljs.org/migration/cra/)
7170
* [Create React App 到 Rsbuild 迁移指南](https://rsbuild.dev/guide/migration/cra)
72-
=======
73-
* [Vite Create React App migration guide](https://www.robinwieruch.de/vite-create-react-app/)
74-
* [Parcel Create React App migration guide](https://parceljs.org/migration/cra/)
75-
* [Rsbuild Create React App migration guide](https://rsbuild.dev/guide/migration/cra)
76-
>>>>>>> fc29603434ec04621139738f4740caed89d659a7
7771

7872
为帮助开发者快速上手 Vite、Parcel 或 Rsbuild,我们新增了 [从零开始构建 React 应用](/learn/build-a-react-app-from-scratch) 文档。
7973

src/content/learn/manipulating-the-dom-with-refs.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -646,21 +646,12 @@ button {
646646

647647
<Recap>
648648

649-
<<<<<<< HEAD
650649
- Refs 是一个通用概念,但大多数情况下你会使用它们来保存 DOM 元素。
651650
- 你通过传递 `<div ref={myRef}>` 指示 React 将 DOM 节点放入 `myRef.current`
652651
- 通常,你会将 refs 用于非破坏性操作,例如聚焦、滚动或测量 DOM 元素。
653-
- 默认情况下,组件不暴露其 DOM 节点。 你可以通过使用 `forwardRef` 并将第二个 `ref` 参数传递给特定节点来暴露 DOM 节点。
652+
- 默认情况下,组件不暴露其 DOM 节点。 你可以通过使用 `ref` 属性来暴露 DOM 节点。
654653
- 避免更改由 React 管理的 DOM 节点。
655654
- 如果你确实修改了 React 管理的 DOM 节点,请修改 React 没有理由更新的部分。
656-
=======
657-
- Refs are a generic concept, but most often you'll use them to hold DOM elements.
658-
- You instruct React to put a DOM node into `myRef.current` by passing `<div ref={myRef}>`.
659-
- Usually, you will use refs for non-destructive actions like focusing, scrolling, or measuring DOM elements.
660-
- A component doesn't expose its DOM nodes by default. You can opt into exposing a DOM node by using the `ref` prop.
661-
- Avoid changing DOM nodes managed by React.
662-
- If you do modify DOM nodes managed by React, modify parts that React has no reason to update.
663-
>>>>>>> fc29603434ec04621139738f4740caed89d659a7
664655

665656
</Recap>
666657

@@ -1060,11 +1051,7 @@ img {
10601051

10611052
<Hint>
10621053

1063-
<<<<<<< HEAD
1064-
你需要 `forwardRef` 来主动从你自己的组件中暴露一个 DOM 节点,比如 `SearchInput`
1065-
=======
1066-
You'll need to pass `ref` as a prop to opt into exposing a DOM node from your own component like `SearchInput`.
1067-
>>>>>>> fc29603434ec04621139738f4740caed89d659a7
1054+
你需要使用 `ref` 属性来主动从你自己的组件中暴露一个 DOM 节点,比如 `SearchInput`
10681055

10691056
</Hint>
10701057

@@ -1149,29 +1136,14 @@ export default function SearchButton({ onClick }) {
11491136
```
11501137

11511138
```js src/SearchInput.js
1152-
<<<<<<< HEAD
1153-
import { forwardRef } from 'react';
1154-
1155-
export default forwardRef(
1156-
function SearchInput(props, ref) {
1157-
return (
1158-
<input
1159-
ref={ref}
1160-
placeholder="找什么呢?"
1161-
/>
1162-
);
1163-
}
1164-
);
1165-
=======
11661139
export default function SearchInput({ ref }) {
11671140
return (
11681141
<input
11691142
ref={ref}
1170-
placeholder="Looking for something?"
1143+
placeholder="找什么呢?"
11711144
/>
11721145
);
11731146
}
1174-
>>>>>>> fc29603434ec04621139738f4740caed89d659a7
11751147
```
11761148

11771149
```css

src/content/reference/react-dom/components/style.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ React 可以将 `<style>` 组件移动到文档的 `<head>` 中,去重相同
5151

5252
这种特殊处理带来两个注意事项:
5353

54-
<<<<<<< HEAD
5554
* 在样式被渲染后,React 将忽略属性的更改(React 在开发环境中会对这种情况发出警告)。
55+
* 当设置了 `precedence` 属性的时候,React 会丢弃除了 `href``precedence` 的之外所有无关属性。
5656
* 即使渲染它的组件已被卸载,React 也可能将样式保留在 DOM 中。
57-
=======
58-
* React will ignore changes to props after the style has been rendered. (React will issue a warning in development if this happens.)
59-
* React will drop all extraneous props when using the `precedence` prop (beyond `href` and `precedence`).
60-
* React may leave the style in the DOM even after the component that rendered it has been unmounted.
61-
>>>>>>> fc29603434ec04621139738f4740caed89d659a7
6257

6358
---
6459

0 commit comments

Comments
 (0)