Skip to content

Commit 2d6cb8f

Browse files
Merge pull request #241 from reactjs/sync-a472775b
Sync with react.dev @ a472775
2 parents e350ba1 + 94dc497 commit 2d6cb8f

File tree

8 files changed

+28
-30
lines changed

8 files changed

+28
-30
lines changed

Diff for: src/content/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To set expectations, this is not a roadmap with clear timelines. Many of these p
2020

2121
## Server Components {/*server-components*/}
2222

23-
We announced an [experimental demo of React Server Components](https://reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components) (RSC) in December 2020. Since then we’ve been finishing up its dependencies in React 18, and working on changes inspired by experimental feedback.
23+
We announced an [experimental demo of React Server Components](https://legacy.reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html) (RSC) in December 2020. Since then we’ve been finishing up its dependencies in React 18, and working on changes inspired by experimental feedback.
2424

2525
In particular, we’re abandoning the idea of having forked I/O libraries (eg react-fetch), and instead adopting an async/await model for better compatibility. This doesn’t technically block RSC’s release because you can also use routers for data fetching. Another change is that we’re also moving away from the file extension approach in favor of [annotating boundaries](https://github.com/reactjs/rfcs/pull/189#issuecomment-1116482278).
2626

Diff for: src/content/community/conferences.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Norway 2023 {/*react-norway-2023*/}
14-
June 16th, 2023. Larvik, Norway
15-
16-
[Website](https://reactnorway.com/) - [Twitter](https://twitter.com/ReactNorway/) - [Facebook](https://www.facebook.com/reactdaynorway/)
17-
18-
### ReactNext 2023 {/*reactnext-2023*/}
19-
June 27th, 2023. Tel Aviv, Israel
20-
21-
[Website](https://www.react-next.com/) - [Facebook](https://www.facebook.com/ReactNextConf) - [Youtube](https://www.youtube.com/@ReactNext)
22-
23-
### React Nexus 2023 {/*react-nexus-2023*/}
24-
July 07 & 08, 2023. Bangalore, India (In-person event)
25-
26-
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
27-
2813
### React Rally 2023 🐙 {/*react-rally-2023*/}
2914
August 17 & 18, 2023. Salt Lake City, UT, USA
3015

@@ -52,6 +37,21 @@ December 8 & 12, 2023. In-person in Berlin, Germany + remote first interactivity
5237

5338
## Past Conferences {/*past-conferences*/}
5439

40+
### React Nexus 2023 {/*react-nexus-2023*/}
41+
July 07 & 08, 2023. Bangalore, India (In-person event)
42+
43+
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
44+
45+
### ReactNext 2023 {/*reactnext-2023*/}
46+
June 27th, 2023. Tel Aviv, Israel
47+
48+
[Website](https://www.react-next.com/) - [Facebook](https://www.facebook.com/ReactNextConf) - [Youtube](https://www.youtube.com/@ReactNext)
49+
50+
### React Norway 2023 {/*react-norway-2023*/}
51+
June 16th, 2023. Larvik, Norway
52+
53+
[Website](https://reactnorway.com/) - [Twitter](https://twitter.com/ReactNorway/) - [Facebook](https://www.facebook.com/reactdaynorway/)
54+
5555
### React Summit 2023 {/*react-summit-2023*/}
5656
June 2 & 6, 2023. In-person in Amsterdam, Netherlands + remote first interactivity (hybrid event)
5757

Diff for: src/content/reference/react-dom/client/hydrateRoot.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Calling `root.unmount` will unmount all the components in the root and "detach"
107107
108108
#### Returns {/*root-unmount-returns*/}
109109
110-
`render` returns `null`.
110+
`root.unmount` returns `undefined`.
111111
112112
#### Caveats {/*root-unmount-caveats*/}
113113

Diff for: src/content/reference/react-dom/components/common.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ These standard DOM props are also supported for all built-in components:
9696
* `onDragStartCapture`: A version of `onDragStart` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
9797
* [`onDrop`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drop_event): A [`DragEvent` handler](#dragevent-handler) function. Fires when something is dropped on a valid drop target.
9898
* `onDropCapture`: A version of `onDrop` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
99-
* `onFocus`: A [`FocusEvent` handler](#focusevent-handler) function. Fires when an element lost focus. Unlike the built-in browser [`focus`](https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event) event, in React the `onFocus` event bubbles.
99+
* `onFocus`: A [`FocusEvent` handler](#focusevent-handler) function. Fires when an element receives focus. Unlike the built-in browser [`focus`](https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event) event, in React the `onFocus` event bubbles.
100100
* `onFocusCapture`: A version of `onFocus` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
101101
* [`onGotPointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/gotpointercapture_event): A [`PointerEvent` handler](#pointerevent-handler) function. Fires when an element programmatically captures a pointer.
102102
* `onGotPointerCaptureCapture`: A version of `onGotPointerCapture` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
@@ -149,7 +149,6 @@ These standard DOM props are also supported for all built-in components:
149149
* [`onWheel`](https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event): A [`WheelEvent` handler](#wheelevent-handler) function. Fires when the user rotates a wheel button.
150150
* `onWheelCapture`: A version of `onWheel` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
151151
* [`role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles): A string. Specifies the element role explicitly for assistive technologies.
152-
nt.
153152
* [`slot`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles): A string. Specifies the slot name when using shadow DOM. In React, an equivalent pattern is typically achieved by passing JSX as props, for example `<Layout left={<Sidebar />} right={<Content />} />`.
154153
* [`spellCheck`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck): A boolean or null. If explicitly set to `true` or `false`, enables or disables spellchecking.
155154
* [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex): A number. Overrides the default Tab button behavior. [Avoid using values other than `-1` and `0`.](https://www.tpgi.com/using-the-tabindex-attribute/)
@@ -169,15 +168,13 @@ These events fire only for the [`<dialog>`](https://developer.mozilla.org/en-US/
169168

170169
* [`onCancel`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event): An [`Event` handler](#event-handler) function. Fires when the user tries to dismiss the dialog.
171170
* `onCancelCapture`: A version of `onCancel` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
172-
capture-phase-events)
173171
* [`onClose`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event): An [`Event` handler](#event-handler) function. Fires when a dialog has been closed.
174172
* `onCloseCapture`: A version of `onClose` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
175173

176174
These events fire only for the [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) elements. Unlike browser events, they bubble in React:
177175

178176
* [`onToggle`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement/toggle_event): An [`Event` handler](#event-handler) function. Fires when the user toggles the details.
179177
* `onToggleCapture`: A version of `onToggle` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
180-
capture-phase-events)
181178

182179
These events fire for [`<img>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img), [`<iframe>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe), [`<object>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object), [`<embed>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed), [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link), and [SVG `<image>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Image_Tag) elements. Unlike browser events, they bubble in React:
183180

Diff for: src/content/reference/react-dom/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ These APIs will be removed in a future major version of React.
3939
* [`findDOMNode`](/reference/react-dom/findDOMNode) finds the closest DOM node corresponding to a class component instance.
4040
* [`hydrate`](/reference/react-dom/hydrate) mounts a tree into the DOM created from server HTML. Deprecated in favor of [`hydrateRoot`](/reference/react-dom/client/hydrateRoot).
4141
* [`render`](/reference/react-dom/render) mounts a tree into the DOM. Deprecated in favor of [`createRoot`](/reference/react-dom/client/createRoot).
42-
* [`unmountComponentAtNode`](/reference/react-dom/unmountComponentAtNode) unmounts a tree from the DOM. Deprecated in favor of [`root.unmount()`.](/reference/react-dom/client/createRoot#root-unmount)
42+
* [`unmountComponentAtNode`](/reference/react-dom/unmountComponentAtNode) unmounts a tree from the DOM. Deprecated in favor of [`root.unmount()`](/reference/react-dom/client/createRoot#root-unmount).
4343

Diff for: src/content/reference/react/Component.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ We recommend using [TypeScript](https://www.typescriptlang.org/) instead of chec
10101010

10111011
If you define `static getDerivedStateFromError`, React will call it when a child component (including distant children) throws an error during rendering. This lets you display an error message instead of clearing the UI.
10121012

1013-
Typically, it is used together with [`componentDidCatch`](#componentDidCatch) which lets you send the error report to some analytics service. A component with these methods is called an *error boundary.*
1013+
Typically, it is used together with [`componentDidCatch`](#componentdidcatch) which lets you send the error report to some analytics service. A component with these methods is called an *error boundary.*
10141014

10151015
[See an example.](#catching-rendering-errors-with-an-error-boundary)
10161016

Diff for: src/content/reference/react/Suspense.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2513,7 +2513,7 @@ However, now imagine you're navigating between two different user profiles. In t
25132513
25142514
---
25152515
2516-
### Providing a fallback for server errors and server-only content {/*providing-a-fallback-for-server-errors-and-server-only-content*/}
2516+
### Providing a fallback for server errors and client-only content {/*providing-a-fallback-for-server-errors-and-client-only-content*/}
25172517
25182518
If you use one of the [streaming server rendering APIs](/reference/react-dom/server) (or a framework that relies on them), React will also use your `<Suspense>` boundaries to handle errors on the server. If a component throws an error on the server, React will not abort the server render. Instead, it will find the closest `<Suspense>` component above it and include its fallback (such as a spinner) into the generated server HTML. The user will see a spinner at first.
25192519

Diff for: src/content/reference/react/useInsertionEffect.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: useInsertionEffect
1010

1111
<Intro>
1212

13-
`useInsertionEffect` is a version of [`useEffect`](/reference/react/useEffect) that fires before any DOM mutations.
13+
`useInsertionEffect` allows inserting elements into the DOM before any layout effects fire.
1414

1515
```js
1616
useInsertionEffect(setup, dependencies?)
@@ -26,7 +26,7 @@ useInsertionEffect(setup, dependencies?)
2626
2727
### `useInsertionEffect(setup, dependencies?)` {/*useinsertioneffect*/}
2828
29-
Call `useInsertionEffect` to insert the styles before any DOM mutations:
29+
Call `useInsertionEffect` to insert styles before any effects fire that may need to read layout:
3030
3131
```js
3232
import { useInsertionEffect } from 'react';
@@ -44,7 +44,7 @@ function useCSS(rule) {
4444
4545
#### Parameters {/*parameters*/}
4646
47-
* `setup`: The function with your Effect's logic. Your setup function may also optionally return a *cleanup* function. Before your component is added to the DOM, React will run your setup function. After every re-render with changed dependencies, React will first run the cleanup function (if you provided it) with the old values, and then run your setup function with the new values. Before your component is removed from the DOM, React will run your cleanup function.
47+
* `setup`: The function with your Effect's logic. Your setup function may also optionally return a *cleanup* function. When your component is added to the DOM, but before any layout effects fire, React will run your setup function. After every re-render with changed dependencies, React will first run the cleanup function (if you provided it) with the old values, and then run your setup function with the new values. When your component is removed from the DOM, React will run your cleanup function.
4848
4949
* **optional** `dependencies`: The list of all reactive values referenced inside of the `setup` code. Reactive values include props, state, and all the variables and functions declared directly inside your component body. If your linter is [configured for React](/learn/editor-setup#linting), it will verify that every reactive value is correctly specified as a dependency. The list of dependencies must have a constant number of items and be written inline like `[dep1, dep2, dep3]`. React will compare each dependency with its previous value using the [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) comparison algorithm. If you don't specify the dependencies at all, your Effect will re-run after every re-render of the component.
5050
@@ -56,8 +56,9 @@ function useCSS(rule) {
5656
5757
* Effects only run on the client. They don't run during server rendering.
5858
* You can't update state from inside `useInsertionEffect`.
59-
* By the time `useInsertionEffect` runs, refs are not attached yet, and DOM is not yet updated.
60-
59+
* By the time `useInsertionEffect` runs, refs are not attached yet.
60+
* `useInsertionEffect` may run either before or after the DOM has been updated. You shouldn't rely on the DOM being updated at any particular time.
61+
* Unlike other types of Effects, which fire cleanup for every Effect and then setup for every Effect, `useInsertionEffect` will fire both cleanup and setup one component at a time. This results in an "interleaving" of the cleanup and setup functions.
6162
---
6263
6364
## Usage {/*usage*/}
@@ -87,7 +88,7 @@ If you use CSS-in-JS, we recommend a combination of the first two approaches (CS
8788
8889
The first problem is not solvable, but `useInsertionEffect` helps you solve the second problem.
8990
90-
Call `useInsertionEffect` to insert the styles before any DOM mutations:
91+
Call `useInsertionEffect` to insert the styles before any layout effects fire:
9192
9293
```js {4-11}
9394
// Inside your CSS-in-JS library

0 commit comments

Comments
 (0)