Skip to content

Commit c66aa38

Browse files
committed
Feedback
1 parent 1cb25a1 commit c66aa38

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/content/blog/2024/04/01/react-19.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,19 +253,22 @@ The `use` API can only be called in render, similar to hooks. Unlike hooks, `use
253253

254254
For more information, see the docs for [`use`](/reference/react/use).
255255

256-
### React Server Components (RSC) {/*new-feature-server-components*/}
256+
257+
### React Server Components {/*react-server-components*/}
258+
259+
### Server Components {/*server-components*/}
257260

258261
Server Components are a new option that allows rendering components ahead of time, before bundling, in an environment separate from your application (the "server"). They can run once at build time, or can be run for each request to a web server.
259262

260-
Today we're releasing React Server Components as semver stable in React 19. This means libraries that ship Server Components and Server Actions can target React 19 as a peer dependency for use in frameworks that support the [Full-stack React Architecture](/learn/start-a-new-react-project#which-features-make-up-the-react-teams-full-stack-architecture-vision).
263+
Today we're releasing React Server Components as semver stable in React 19. TODO: re-write This means libraries that ship Server Components and Server Actions can target React 19 as a peer dependency for use in frameworks that support the [Full-stack React Architecture](/learn/start-a-new-react-project#which-features-make-up-the-react-teams-full-stack-architecture-vision).
261264

262-
For more, see the docs for [React Server Components](/reference/full-stack/server-components).
265+
For more, see the docs for [React Server Components](/reference/rsc/server-components).
263266

264267
<DeepDive>
265268

266269
#### How do I use Server Components? {/*how-do-i-use-server-components*/}
267270

268-
We first announced React Server Components (RSC) in a [demo in December 2020](https://legacy.reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html). In 2022, we merged the [RFC for React Server Components](https://github.com/reactjs/rfcs/blob/main/text/0188-server-components.md) and the [RFC for React Server Module Conventions](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md) and partnered with Next.js for the first implementation in the Next.js 13 App Router beta. We worked with the Next.js team to implement Server Components via the stable Canary channel, and Server Components shipped as the default in Next.js 14.
271+
We first announced React Server Components in a [demo in December 2020](https://legacy.reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html). In 2022, we merged the [RFC for React Server Components](https://github.com/reactjs/rfcs/blob/main/text/0188-server-components.md) and the [RFC for React Server Module Conventions](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md) and partnered with Next.js for the first implementation in the Next.js 13 App Router beta. We worked with the Next.js team to implement Server Components via the stable Canary channel, and Server Components shipped as the default in Next.js 14.
269272

270273
We will continue working with bundlers and framework authors to expand support for React Server Components.
271274

@@ -277,15 +280,15 @@ TODO:
277280

278281
</DeepDive>
279282

280-
### React Server Actions (RSA) {/*react-server-actions-rsa*/}
283+
### Server Actions {/*server-actions*/}
281284

282285
Server Actions allow Client Components to call async functions executed on the server.
283286

284287
When a Server Action is defined with the `"use server"` directive, your framework will automatically create a reference to the server function, and pass that reference to the Client Component. When that function is called on the client, React will send a request to the server to execute the function, and return the result.
285288

286289
Server Actions can be created in Server Components and passed as props to Client Components, or they can be imported and used in Client Components.
287290

288-
For more, see the docs for [React Server Actions](/reference/full-stack/server-actions).
291+
For more, see the docs for [React Server Actions](/reference/rsc/server-actions).
289292

290293
<DeepDive>
291294

@@ -409,12 +412,12 @@ In HTML, document metadata tags like `<title>` and `<meta>` are reserved for pla
409412
In React 19, we're adding support for rendering document metadata tags in components natively:
410413

411414
```js {5,6}
412-
function Component() {
415+
function BlogPost({post}) {
413416
return (
414417
<div>
415-
<p>Hello World</p>
416-
<title>Hello World</title>
417-
<meta name="keywords" content="React 19"/>
418+
<p>{post.title}</p>
419+
<title>{post.title}</title>
420+
<meta name="keywords" content={post.keywords} />
418421
</div>
419422
);
420423
}
@@ -449,7 +452,11 @@ To maintain compatibility with HTML and optimize performance, React will dedupe
449452
450453
### Improved hydration for third-party scripts {/*improved-hydration-for-third-party-scripts*/}
451454
452-
We've improved hydration to account for third-party scripts and browser extensions. TODO: explain how.
455+
We've improved hydration to account for third-party scripts and browser extensions.
456+
457+
When hydrating, if an element that renders on the client doesn't match the element found in the HTML from the server, React will force a client re-render to fix up the content. Previously, if an element was inserted by third-party scripts or browser extensions, it would trigger a mismatch error and client render.
458+
459+
In React 19 unexpected tags in the `<head>` and `<body>` will be skipped over, avoiding the mismatch errors. If React needs to re-render the entire document due to an unrelated hydration mismatch, it will leave in place stylesheets inserted by third-party scripts and browser extensions.
453460
454461
### Better Error Reporting {/*error-handling*/}
455462

0 commit comments

Comments
 (0)