Skip to content

docs(en): merge reactjs.org/main into zh-hans.reactjs.org/main @ 947681ea #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/learn/creating-a-react-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ Next.js 的 App Router 还集成了 [使用 Suspense 的数据获取](/blog/2022

从零开始可以给你更多的灵活性,但同时也要求你必须自己选择用于路由、数据获取以及其他常见使用模式的工具。这更像自己构建一个框架,而不是使用一个已经存在的框架。[我们推荐的框架](#full-stack-frameworks) 为这些问题提供了内置的解决方案。

<<<<<<< HEAD
如果你想构建自己的解决方案,请参阅我们的 [从零构建一个 React 应用](/learn/build-a-react-app-from-scratch) 指南,该指南提供了如何使用 [Vite](https://vite.dev/), [Parcel](https://parceljs.org/),或 [RSbuild](https://rsbuild.dev/) 等构建工具设置新 React 项目的说明。
=======
If you want to build your own solutions, see our guide to [build a React app from Scratch](/learn/build-a-react-app-from-scratch) for instructions on how to set up a new React project starting with a build tool like [Vite](https://vite.dev/), [Parcel](https://parceljs.org/), or [RSbuild](https://rsbuild.dev/).
>>>>>>> 947681ea20f278c64200ea1107062765948f5a10

-----

Expand Down
5 changes: 3 additions & 2 deletions src/content/reference/react-dom/client/hydrateRoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,13 @@ It is uncommon to call [`root.render`](#root-render) on a hydrated root. Usually

By default, React will log all errors to the console. To implement your own error reporting, you can provide the optional error handler root options `onUncaughtError`, `onCaughtError` and `onRecoverableError`:

```js [[1, 6, "onCaughtError"], [2, 6, "error", 1], [3, 6, "errorInfo"], [4, 10, "componentStack", 15]]
```js [[1, 7, "onCaughtError"], [2, 7, "error", 1], [3, 7, "errorInfo"], [4, 11, "componentStack", 15]]
import { hydrateRoot } from "react-dom/client";
import App from "./App.js";
import { reportCaughtError } from "./reportError";

const container = document.getElementById("root");
const root = hydrateRoot(container, {
const root = hydrateRoot(container, <App />, {
onCaughtError: (error, errorInfo) => {
if (error.message !== "Known error") {
reportCaughtError({
Expand Down
3 changes: 2 additions & 1 deletion src/content/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The React docs at [react.dev](https://react.dev) provide documentation for the l
We aim to keep the docs updated within major versions, and do not publish versions for each minor or patch version. When a new major is released, we archive the docs for the previous version as `x.react.dev`. See our [versioning policy](/community/versioning-policy) for more info.

You can find an archive of previous major versions below.
## Latest version: 19.0 {/*latest-version*/}
## Latest version: 19.1 {/*latest-version*/}

- [react.dev](https://react.dev) {/*docs-19*/}

Expand Down Expand Up @@ -51,6 +51,7 @@ For versions older than React 15, see [15.react.dev](https://15.react.dev).
- [React 19 Deep Dive: Coordinating HTML](https://www.youtube.com/watch?v=IBBN-s77YSI)

**Releases**
- [v19.1.0 (March, 2025)](https://github.com/facebook/react/blob/main/CHANGELOG.md#1910-march-28-2025)
- [v19.0.0 (December, 2024)](https://github.com/facebook/react/blob/main/CHANGELOG.md#1900-december-5-2024)

### React 18 {/*react-18*/}
Expand Down