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

+11-1
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

+2-2
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

+17-12
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

+2-2
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

+1-1
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

+2-1
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

+1-1
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

+2-2
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

+1-1
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

-1
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

src/content/learn/queueing-a-series-of-state-updates.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ React가 이벤트 핸들러를 수행하는 동안 여러 코드를 통해 작
126126

127127
React는 `3`을 최종 결과로 저장하고 `useState`에서 반환합니다.
128128

129-
이것이 위 예시 "+3"을 클릭하면 값이 3씩 올바르게 증가하는 이유입니다.
129+
이것이 위 예시 "+3"을 클릭하면 값이 3씩 올바르게 증가하는 이유입니다.
130130

131131
### state를 교체한 후 업데이트하면 어떻게 되나요? {/*what-happens-if-you-update-state-after-replacing-it*/}
132132

@@ -230,7 +230,7 @@ h1 { display: inline-block; margin: 10px; width: 30px; text-align: center; }
230230

231231
1. `setNumber(number + 5)`: `number``0` 이므로 `setNumber(0 + 5)`입니다. React는 *"`5`로 바꾸기"* 를 큐에 추가합니다.
232232
2. `setNumber(n => n + 1)`: `n => n + 1` 는 업데이터 함수입니다. React는 *이 함수*를 큐에 추가합니다.
233-
3. `setNumber(42)`: React는 *"`42`로 바꾸기"* 를 큐에 추가합니다.
233+
3. `setNumber(42)`: React는 *"`42`로 바꾸기"* 를 큐에 추가합니다.
234234

235235
다음 렌더링하는 동안, React는 state 큐를 순회합니다.
236236

src/content/learn/reusing-logic-with-custom-hooks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ export function useChatRoom({ serverUrl, roomId, onReceiveMessage }) {
922922
}
923923
```
924924
925-
이제 `ChatRoom`가 재렌더링될 때마다 채팅방이 재연결되지 않습니다. 여기 커스텀 Hook에 이벤트 핸들러를 넘겨주는 직접 다뤄볼 수 있는 제대로 동작하는 예시가 있습니다.
925+
이제 `ChatRoom`가 재렌더링될 때마다 채팅방이 재연결되지 않습니다. 여기 커스텀 Hook에 이벤트 핸들러를 넘겨주는 직접 다뤄볼 수 있는 제대로 동작하는 예시가 있습니다.
926926
927927
<Sandpack>
928928
@@ -1332,7 +1332,7 @@ export function useOnlineStatus() {
13321332
13331333
위의 예시에서 `useOnlineStatus`는 한 쌍의 [`useState`](/reference/react/useState)와 [`useEffect`](/reference/react/useEffect)와 함께 실행됩니다. 하지만 이건 가장 좋은 해결 방법은 아닙니다. 이 해결 방법이 고려하지 못한 수많은 예외 상황이 존재합니다. 예를 들어, 이건 컴포넌트가 마운트됐을 때, `isOnline`이 이미 `true`라고 가정합니다. 하지만 이것은 네트워크가 이미 꺼졌을 때 틀린 가정이 됩니다. 이런 상황을 확인하기 위해 브라우저 [`navigator.onLine`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine) API를 사용할 수도 있습니다. 하지만 이걸 직접적으로 사용하게 되면 초기 HTML을 생성하기 위한 서버에선 동작하지 않습니다. 짧게 말하면 코드는 보완되어야 합니다.
13341334
1335-
운 좋게도 React 18은 이런 모든 문제를 신경 써주는 [`useSyncExternalStore`](/reference/react/useSyncExternalStore)라고 불리는 섬세한 API를 포함합니다. 여기 새 API의 장점을 가지고 다시 쓰인 `useOnlineStatus`이 있습니다.
1335+
React는 이런 모든 문제를 신경 써주는 [`useSyncExternalStore`](/reference/react/useSyncExternalStore)라고 불리는 섬세한 API를 포함합니다. 여기 새 API의 장점을 가지고 다시 쓰인 `useOnlineStatus`이 있습니다.
13361336
13371337
<Sandpack>
13381338

src/content/learn/sharing-state-between-components.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ state를 올리려면, 조정하려는 *두* 자식 컴포넌트의 가장 가
125125
- `Panel`
126126
- `Panel`
127127
128-
예시에서는 `Accordion` 컴포넌트입니다. 이 컴포넌트는 두 패널의 상위에 있고 props를 제어할 수 있기 때문에 현재 어느 패널이 활성화되었는지에 대한 "진리의 원천(source of truth)"이 됩니다. `Accordion` 컴포넌트가 하드 코딩된 값을 가지는 `isActive`를 (예를 들면 `true`) 두 패널에 전달하도록 만듭니다.
128+
예시에서는 `Accordion` 컴포넌트입니다. 이 컴포넌트는 두 패널의 상위에 있고 props를 제어할 수 있기 때문에 현재 어느 패널이 활성화되었는지에 대한 "진리의 원천(source of truth)"이 됩니다. `Accordion` 컴포넌트가 하드 코딩된 값을 가지는 `isActive`를 (예를 들면 `true`) 두 패널에 전달하도록 만듭니다.
129129
130130
<Sandpack>
131131

src/content/learn/tutorial-tic-tac-toe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ export default function Board() {
944944
}
945945
```
946946
947-
`Array(9).fill(null)`은 9개의 엘리먼트로 배열을 생성하고 각 엘리먼트를 `null`로 설정합니다. 그 주위에 있는 `useState()` 호출은 처음에 해당 배열로 설정된 state 변수 `squares`를 선언합니다. 배열의 각 항목은 사각형의 값에 해당합니다. 나중에 보드를 채우면, `squares` 배열은 다음과 같은 모양이 됩니다.
947+
`Array(9).fill(null)`은 9개의 엘리먼트로 배열을 생성하고 각 엘리먼트를 `null`로 설정합니다. 그 주위에 있는 `useState()` 호출은 처음에 해당 배열로 설정된 state 변수 `squares`를 선언합니다. 배열의 각 항목은 사각형의 값에 해당합니다. 나중에 보드를 채우면, `squares` 배열은 다음과 같은 모양이 됩니다.
948948
949949
```jsx
950950
['O', null, 'X', 'X', 'X', 'O', 'O', null, null]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ You can [make an input controlled](#controlling-an-input-with-a-state-variable)
5656
* [`dirname`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#dirname): 문자열 타입. 엘리먼트 방향성에 대한 폼 필드 이름을 지정합니다.
5757
* [`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled): 불리언 타입. `true`일 경우, 입력은 상호작용이 불가능해지며 흐릿하게 보입니다.
5858
* `children`: `<input>` 은 자식을 받지 않습니다.
59-
* [`form`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form): 문자열 타입. 입력이 속하는 `<form>``id`를 지정합니다. 생략 시 가장 가까운 부모 폼으로 설정됩니다.
59+
* [`form`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form): 문자열 타입. 입력이 속하는 `<form>``id`를 지정합니다. 생략 시 가장 가까운 부모 폼으로 설정됩니다.
6060
* [`formAction`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formaction): 문자열 타입. `type="submit"``type="image"`의 부모 `<form action>` 을 덮어씁니다.
6161
* [`formEnctype`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formenctype): 문자열 타입. `type="submit"``type="image"`의 부모 `<form enctype>` 을 덮어씁니다.
6262
* [`formMethod`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formmethod): 문자열 타입. `type="submit"``type="image"`의 부모 `<form method>` 를 덮어씁니다.

src/content/reference/react/Component.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ button { margin-left: 10px; }
12731273
12741274
error boundary 컴포넌트를 구현하려면 오류에 대한 응답으로 state를 업데이트하고 사용자에게 오류 메시지를 표시할 수 있는 [`static getDerivedStateFromError`](#static-getderivedstatefromerror)를 제공해야 합니다. 또한 선택적으로 [`componentDidCatch`](#componentdidcatch)를 구현하여 분석 서비스에 오류를 기록하는 등의 추가 로직을 추가할 수도 있습니다.
12751275
1276-
<CanaryBadge /> With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
1276+
With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
12771277
12781278
```js {9-12,14-27}
12791279
import * as React from 'react';
@@ -1298,8 +1298,7 @@ class ErrorBoundary extends React.Component {
12981298
// in div (created by App)
12991299
// in App
13001300
info.componentStack,
1301-
// Only available in react@canary.
1302-
// Warning: Owner Stack is not available in production.
1301+
// Warning: `captureOwnerStack` is not available in production.
13031302
React.captureOwnerStack(),
13041303
);
13051304
}

src/content/reference/react/StrictMode.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Strict Mode에서는 개발 시 다음과 같은 검사를 가능하게 합니
8989

9090
- 컴포넌트가 순수하지 않은 렌더링으로 인한 버그를 찾기 위해 [추가로 다시 렌더링합니다.](#fixing-bugs-found-by-double-rendering-in-development)
9191
- 컴포넌트가 Effect 클린업이 누락되어 발생한 버그를 찾기 위해 [Effect를 다시 실행합니다.](#fixing-bugs-found-by-re-running-effects-in-development)
92-
- Your components will [re-run ref callbacks an extra time](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) to find bugs caused by missing ref cleanup.
92+
- Your components will [re-run refs callbacks an extra time](#fixing-bugs-found-by-re-running-ref-callbacks-in-development) to find bugs caused by missing ref cleanup.
9393
- 컴포넌트가 [더 이상 사용되지 않는 API를 사용하는지 확인합니다.](#fixing-deprecation-warnings-enabled-by-strict-mode)
9494

9595

@@ -124,6 +124,12 @@ function App() {
124124

125125
이 예시에서 `Header``Footer` 컴포넌트에서는 Strict Mode 검사가 실행되지 않습니다. 그러나 `Sidebar``Content`, 그리고 그 자손 컴포넌트는 깊이에 상관없이 검사가 실행됩니다.
126126

127+
<Note>
128+
129+
When `StrictMode` is enabled for a part of the app, React will only enable behaviors that are possible in production. For example, if `<StrictMode>` is not enabled at the root of the app, it will not [re-run Effects an extra time](#fixing-bugs-found-by-re-running-effects-in-development) on initial mount, since this would cause child effects to double fire without the parent effects, which cannot happen in production.
130+
131+
</Note>
132+
127133
---
128134

129135
### 개발 중 이중 렌더링으로 발견한 버그 수정 {/*fixing-bugs-found-by-double-rendering-in-development*/}

src/content/reference/react/act.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You might find using `act()` directly a bit too verbose. To avoid some of the bo
2727

2828
### `await act(async actFn)` {/*await-act-async-actfn*/}
2929

30-
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as units of interaction with a user interface. React provides a helper called `act()` that makes sure all updates related to these units have been processed and applied to the DOM before you make any assertions.
30+
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called `act()` that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions.
3131

3232
The name `act` comes from the [Arrange-Act-Assert](https://wiki.c2.com/?ArrangeActAssert) pattern.
3333

src/content/reference/react/captureOwnerStack.md

-54
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
title: captureOwnerStack
33
---
44

5-
<Canary>
6-
7-
The `captureOwnerStack` API is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8-
9-
</Canary>
10-
115
<Intro>
126

137
`captureOwnerStack` reads the current Owner Stack in development and returns it as a string if available.
@@ -126,22 +120,6 @@ createRoot(document.createElement('div'), {
126120
);
127121
```
128122

129-
```json package.json hidden
130-
{
131-
"dependencies": {
132-
"react": "canary",
133-
"react-dom": "canary",
134-
"react-scripts": "latest"
135-
},
136-
"scripts": {
137-
"start": "react-scripts start",
138-
"build": "react-scripts build",
139-
"test": "react-scripts test --env=jsdom",
140-
"eject": "react-scripts eject"
141-
}
142-
}
143-
```
144-
145123
```html public/index.html hidden
146124
<!DOCTYPE html>
147125
<html lang="en">
@@ -357,22 +335,6 @@ const container = document.getElementById("root");
357335
createRoot(container).render(<App />);
358336
```
359337

360-
```json package.json hidden
361-
{
362-
"dependencies": {
363-
"react": "canary",
364-
"react-dom": "canary",
365-
"react-scripts": "latest"
366-
},
367-
"scripts": {
368-
"start": "react-scripts start",
369-
"build": "react-scripts build",
370-
"test": "react-scripts test --env=jsdom",
371-
"eject": "react-scripts eject"
372-
}
373-
}
374-
```
375-
376338
```js src/App.js
377339
function Component() {
378340
return <button onClick={() => console.error('Some console error')}>Trigger console.error()</button>;
@@ -417,22 +379,6 @@ export default function App() {
417379
}
418380
```
419381

420-
```json package.json hidden
421-
{
422-
"dependencies": {
423-
"react": "canary",
424-
"react-dom": "canary",
425-
"react-scripts": "latest"
426-
},
427-
"scripts": {
428-
"start": "react-scripts start",
429-
"build": "react-scripts build",
430-
"test": "react-scripts test --env=jsdom",
431-
"eject": "react-scripts eject"
432-
}
433-
}
434-
```
435-
436382
</Sandpack>
437383

438384
### `captureOwnerStack` is not available {/*captureownerstack-is-not-available*/}

0 commit comments

Comments
 (0)