Skip to content

Commit 731c6ac

Browse files
authored
Sync with react.dev @ 5138e60 (#1173)
This PR was automatically generated. Merge changes from [react.dev](https://github.com/reactjs/react.dev/commits/main) at 5138e60 The following files have conflicts and may need new translations: * [x] [src/content/learn/reusing-logic-with-custom-hooks.md](/reactjs/react.dev/commits/main/src/content/learn/reusing-logic-with-custom-hooks.md) * [x] [src/content/learn/tutorial-tic-tac-toe.md](/reactjs/react.dev/commits/main/src/content/learn/tutorial-tic-tac-toe.md) * [x] [src/content/reference/react/StrictMode.md](/reactjs/react.dev/commits/main/src/content/reference/react/StrictMode.md) * [x] [src/content/reference/react/useSyncExternalStore.md](/reactjs/react.dev/commits/main/src/content/reference/react/useSyncExternalStore.md) Please fix the conflicts by pushing new commits to this pull request, either by editing the files directly on GitHub or by checking out this branch. ## DO NOT SQUASH MERGE THIS PULL REQUEST! Doing so will "erase" the commits from main and cause them to show up as conflicts the next time we merge.
2 parents 663ad9a + a54d888 commit 731c6ac

31 files changed

+85
-121
lines changed

eslint.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-anonymous-default-export */
12
import mark from 'eslint-plugin-mark';
23

34
export default [
@@ -8,7 +9,16 @@ export default [
89
...mark.configs.baseGfm,
910
files: ['src/content/**/*.md'],
1011
rules: {
11-
'mark/no-double-spaces': 'error',
12+
'mark/no-curly-quote': [
13+
'error',
14+
{leftSingleQuotationMark: false, rightSingleQuotationMark: false},
15+
],
16+
'mark/no-double-space': 'error',
17+
'mark/no-git-conflict-marker': ['error', {skipCode: false}],
18+
'mark/no-irregular-whitespace': [
19+
'error',
20+
{skipCode: false, skipInlineCode: false},
21+
],
1222
},
1323
},
1424
];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"lint-editorconfig": "yarn editorconfig-checker",
2424
"textlint-test": "yarn mocha ./textlint/tests/utils && yarn mocha ./textlint/tests/rules",
2525
"textlint-docs": "node ./textlint/generators/genTranslateGlossaryDocs.js && git add wiki/translate-glossary.md",
26-
"textlint-lint": "yarn textlint ./src/content --rulesdir ./textlint/rules -f pretty-error"
26+
"textlint-lint": "yarn textlint ./src/content --rulesdir ./textlint/rules -f pretty-error && npx --yes eslint@9 -c eslint.config.mjs"
2727
},
2828
"dependencies": {
2929
"@codesandbox/sandpack-react": "2.13.5",
@@ -72,7 +72,7 @@
7272
"eslint-plugin-flowtype": "4.x",
7373
"eslint-plugin-import": "2.x",
7474
"eslint-plugin-jsx-a11y": "6.x",
75-
"eslint-plugin-mark": "^0.1.0-canary.1",
75+
"eslint-plugin-mark": "^0.1.0-canary.2",
7676
"eslint-plugin-react": "7.x",
7777
"eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
7878
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",

src/components/MDX/ErrorDecoder.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function parseQueryString(search: string): Array<string | undefined> {
6969
}
7070

7171
export default function ErrorDecoder() {
72-
const {errorMessage} = useErrorDecoderParams();
72+
const {errorMessage, errorCode} = useErrorDecoderParams();
7373
/** error messages that contain %s require reading location.search */
7474
const hasParams = errorMessage?.includes('%s');
7575
const [message, setMessage] = useState<React.ReactNode | null>(() =>
@@ -82,23 +82,28 @@ export default function ErrorDecoder() {
8282
if (errorMessage == null || !hasParams) {
8383
return;
8484
}
85+
const args = parseQueryString(window.location.search);
86+
let message = errorMessage;
87+
if (errorCode === '418') {
88+
// Hydration errors have a %s for the diff, but we don't add that to the args for security reasons.
89+
message = message.replace(/%s$/, '');
8590

86-
setMessage(
87-
urlify(
88-
replaceArgs(
89-
errorMessage,
90-
parseQueryString(window.location.search),
91-
'[missing argument]'
92-
)
93-
)
94-
);
91+
// Before React 19.1, the error message didn't have an arg, and was always HTML.
92+
if (args.length === 0) {
93+
args.push('HTML');
94+
} else if (args.length === 1 && args[0] === '') {
95+
args[0] = 'HTML';
96+
}
97+
}
98+
99+
setMessage(urlify(replaceArgs(message, args, '[missing argument]')));
95100
setIsReady(true);
96-
}, [hasParams, errorMessage]);
101+
}, [errorCode, hasParams, errorMessage]);
97102

98103
return (
99104
<code
100105
className={cn(
101-
'block bg-red-100 text-red-600 py-4 px-6 mt-5 rounded-lg',
106+
'whitespace-pre-line block bg-red-100 text-red-600 py-4 px-6 mt-5 rounded-lg',
102107
isReady ? 'opacity-100' : 'opacity-0'
103108
)}>
104109
<b>{message}</b>

src/components/MDX/Sandpack/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ root.render(
2828
eject: 'react-scripts eject',
2929
},
3030
dependencies: {
31-
react: '19.0.0-rc-3edc000d-20240926',
32-
'react-dom': '19.0.0-rc-3edc000d-20240926',
31+
react: '^19.1.0',
32+
'react-dom': '^19.1.0',
3333
'react-scripts': '^5.0.0',
3434
},
3535
},

src/content/blog/2024/12/05/react-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: The React Team
44
date: 2024/12/05
55
description: React 19 is now available on npm! In this post, we'll give an overview of the new features in React 19, and how you can adopt them.
66
---
7-
7+
{/*<!-- eslint-disable mark/no-double-space -->*/}
88
December 05, 2024 by [The React Team](/community/team)
99

1010
---

src/content/community/meetups.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
8181
* [Thessaloniki](https://www.meetup.com/Thessaloniki-ReactJS-Meetup/)
8282

8383
## India {/*india*/}
84-
* [Ahmedabad](https://www.meetup.com/react-ahmedabad/)
84+
* [Ahmedabad](https://reactahmedabad.dev/)
8585
* [Bangalore (React)](https://www.meetup.com/ReactJS-Bangalore/)
8686
* [Bangalore (React Native)](https://www.meetup.com/React-Native-Bangalore-Meetup)
8787
* [Chennai](https://www.linkedin.com/company/chennaireact)
@@ -169,6 +169,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
169169
* [Cleveland, OH - ReactJS](https://www.meetup.com/Cleveland-React/)
170170
* [Columbus, OH - ReactJS](https://www.meetup.com/ReactJS-Columbus-meetup/)
171171
* [Dallas, TX - ReactJS](https://www.meetup.com/ReactDallas/)
172+
* [Denver, CO - React Denver](https://reactdenver.com/)
172173
* [Detroit, MI - Detroit React User Group](https://www.meetup.com/Detroit-React-User-Group/)
173174
* [Indianapolis, IN - React.Indy](https://www.meetup.com/React-Indy)
174175
* [Irvine, CA - ReactJS](https://www.meetup.com/ReactJS-OC/)

src/content/community/versioning-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This versioning policy describes our approach to version numbers for packages su
1111

1212
## Stable releases {/*stable-releases*/}
1313

14-
Stable React releases (also known as Latest release channel) follow [semantic versioning (semver)](https://semver.org/lang/ko/) principles.
14+
Stable React releases (also known as "Latest" release channel) follow [semantic versioning (semver)](https://semver.org/lang/ko/) principles.
1515

1616
버전 번호 **x.y.z**를 사용할 때 다음과 같습니다.
1717

src/content/learn/build-a-react-app-from-scratch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Rsbuild includes built-in support for React features like fast refresh, JSX, Typ
6565

6666
#### Metro for React Native {/*react-native*/}
6767

68-
If you'd you're starting from scratch with React Native you'll need to use [Metro](https://metrobundler.dev/), the JavaScript bundler for React Native. Metro supports bundling for platforms like iOS and Android, but lacks many features when compared to the tools here. We recommend starting with Vite, Parcel, or Rsbuild unless your project requires React Native support.
68+
If you're starting from scratch with React Native you'll need to use [Metro](https://metrobundler.dev/), the JavaScript bundler for React Native. Metro supports bundling for platforms like iOS and Android, but lacks many features when compared to the tools here. We recommend starting with Vite, Parcel, or Rsbuild unless your project requires React Native support.
6969

7070
</Note>
7171

@@ -83,7 +83,7 @@ Routers are a core part of modern applications, and are usually integrated with
8383

8484
We suggest using:
8585

86-
- [React Router](https://reactrouter.com/start/framework/custom)
86+
- [React Router](https://reactrouter.com/start/data/custom)
8787
- [Tanstack Router](https://tanstack.com/router/latest)
8888

8989

src/content/learn/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export default function MyApp() {
475475
}
476476
```
477477
478-
이렇게 전달한 정보를 *props*라고 합니다. 이제 `MyApp` 컴포넌트는 `count` state와 `handleClick` 이벤트 핸들러를 포함하며, *이 두 가지를 각 버튼에 props로 전달합니다*.
478+
이렇게 전달한 정보를 *props*라고 합니다. 이제 `MyApp` 컴포넌트는 `count` state와 `handleClick` 이벤트 핸들러를 포함하며, *이 두 가지를 각 버튼에 props로 전달합니다*.
479479
480480
마지막으로 부모 컴포넌트에서 전달한 props를 *읽도록* `MyButton`을 변경합니다.
481481

src/content/learn/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ If a framework is not a good fit for your project, you prefer to build your own
6868
No. Create React App has been deprecated. For more information, see [Sunsetting Create React App](/blog/2025/02/14/sunsetting-create-react-app).
6969

7070
</Note>
71-
>>>>>>> ab18d2f0f5151ab0c927a12eb0a64f8170762eff
7271

7372
## 다음 단계 {/*next-steps*/}
7473

0 commit comments

Comments
 (0)