You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/content/learn/manipulating-the-dom-with-refs.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -493,7 +493,7 @@ In general, you [don't want](/learn/referencing-values-with-refs#best-practices-
493
493
494
494
React sets `ref.current` during the commit. Before updating the DOM, React sets the affected `ref.current` values to `null`. After updating the DOM, React immediately sets them to the corresponding DOM nodes.
495
495
496
-
**Usually, you will access refs from event handlers.** If you want to do something with a ref, but there is no particular event to do it in, you might need an Effect. We will discuss effects on the next pages.
496
+
**Usually, you will access refs from event handlers.** If you want to do something with a ref, but there is no particular event to do it in, you might need an Effect. We will discuss Effects on the next pages.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/flushSync.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Most of the time, `flushSync` can be avoided. Use `flushSync` as last resort.
53
53
54
54
*`flushSync` can significantly hurt performance. Use sparingly.
55
55
*`flushSync` may force pending Suspense boundaries to show their `fallback` state.
56
-
*`flushSync` may run pending effects and synchronously apply any updates they contain before returning.
56
+
*`flushSync` may run pending Effects and synchronously apply any updates they contain before returning.
57
57
*`flushSync` may flush updates outside the callback when necessary to flush the updates inside the callback. For example, if there are pending updates from a click, React may flush those before flushing the updates inside the callback.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/hydrate.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ This only works one level deep, and is intended to be an escape hatch. Don’t o
152
152
153
153
### Handling different client and server content {/*handling-different-client-and-server-content*/}
154
154
155
-
If you intentionally need to render something different on the server and the client, you can do a two-pass rendering. Components that render something different on the client can read a [state variable](/reference/react/useState) like `isClient`, which you can set to `true` in an [effect](/reference/react/useEffect):
155
+
If you intentionally need to render something different on the server and the client, you can do a two-pass rendering. Components that render something different on the client can read a [state variable](/reference/react/useState) like `isClient`, which you can set to `true` in an [Effect](/reference/react/useEffect):
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/preconnect.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The `preconnect` function provides the browser with a hint that it should open a
55
55
#### Caveats {/*caveats*/}
56
56
57
57
* Multiple calls to `preconnect` with the same server have the same effect as a single call.
58
-
* In the browser, you can call `preconnect` in any situation: while rendering a component, in an effect, in an event handler, and so on.
58
+
* In the browser, you can call `preconnect` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
59
59
* In server-side rendering or when rendering Server Components, `preconnect` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
60
60
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
61
61
* There is no benefit to preconnecting to the same server the webpage itself is hosted from because it's already been connected to by the time the hint would be given.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/prefetchDNS.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ The prefetchDNS function provides the browser with a hint that it should look up
54
54
#### Caveats {/*caveats*/}
55
55
56
56
* Multiple calls to `prefetchDNS` with the same server have the same effect as a single call.
57
-
* In the browser, you can call `prefetchDNS` in any situation: while rendering a component, in an effect, in an event handler, and so on.
57
+
* In the browser, you can call `prefetchDNS` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
58
58
* In server-side rendering or when rendering Server Components, `prefetchDNS` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
59
59
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
60
60
* There is no benefit to prefetching the same server the webpage itself is hosted from because it's already been looked up by the time the hint would be given.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/preinit.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ The `preinit` function provides the browser with a hint that it should start dow
67
67
#### Caveats {/*caveats*/}
68
68
69
69
* Multiple calls to `preinit` with the same `href` have the same effect as a single call.
70
-
* In the browser, you can call `preinit` in any situation: while rendering a component, in an effect, in an event handler, and so on.
70
+
* In the browser, you can call `preinit` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
71
71
* In server-side rendering or when rendering Server Components, `preinit` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/preinitModule.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ The `preinitModule` function provides the browser with a hint that it should sta
65
65
#### Caveats {/*caveats*/}
66
66
67
67
* Multiple calls to `preinitModule` with the same `href` have the same effect as a single call.
68
-
* In the browser, you can call `preinitModule` in any situation: while rendering a component, in an effect, in an event handler, and so on.
68
+
* In the browser, you can call `preinitModule` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
69
69
* In server-side rendering or when rendering Server Components, `preinitModule` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/preload.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ The `preload` function provides the browser with a hint that it should start dow
72
72
* Multiple equivalent calls to `preload` have the same effect as a single call. Calls to `preload` are considered equivalent according to the following rules:
73
73
* Two calls are equivalent if they have the same `href`, except:
74
74
* If `as` is set to `image`, two calls are equivalent if they have the same `href`, `imageSrcSet`, and `imageSizes`.
75
-
* In the browser, you can call `preload` in any situation: while rendering a component, in an effect, in an event handler, and so on.
75
+
* In the browser, you can call `preload` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
76
76
* In server-side rendering or when rendering Server Components, `preload` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
Copy file name to clipboardexpand all lines: src/content/reference/react-dom/preloadModule.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ The `preloadModule` function provides the browser with a hint that it should sta
66
66
#### Caveats {/*caveats*/}
67
67
68
68
* Multiple calls to `preloadModule` with the same `href` have the same effect as a single call.
69
-
* In the browser, you can call `preloadModule` in any situation: while rendering a component, in an effect, in an event handler, and so on.
69
+
* In the browser, you can call `preloadModule` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
70
70
* In server-side rendering or when rendering Server Components, `preloadModule` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
*`id`: The string `id` prop of the `<Profiler>` tree that has just committed. This lets you identify which part of the tree was committed if you are using multiple profilers.
57
-
*`phase`: `"mount"`, `"update"` or `"nested-update"`. This lets you know whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks.
57
+
*`phase`: `"mount"`, `"update"` or `"nested-update"`. This lets you know whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or Hooks.
58
58
*`actualDuration`: The number of milliseconds spent rendering the `<Profiler>` and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. [`memo`](/reference/react/memo) and [`useMemo`](/reference/react/useMemo)). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.
59
59
*`baseDuration`: The number of milliseconds estimating how much time it would take to re-render the entire `<Profiler>` subtree without any optimizations. It is calculated by summing up the most recent render durations of each component in the tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization). Compare `actualDuration` against it to see if memoization is working.
60
60
*`startTime`: A numeric timestamp for when React began rendering the current update.
Copy file name to clipboardexpand all lines: src/content/reference/react/Suspense.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -1348,7 +1348,7 @@ input { margin: 10px; }
1348
1348
1349
1349
<Note>
1350
1350
1351
-
Both deferred values and [transitions](#preventing-already-revealed-content-from-hiding) let you avoid showing Suspense fallback in favor of inline indicators. Transitions mark the whole update as non-urgent so they are typically used by frameworks and router libraries for navigation. Deferred values, on the other hand, are mostly useful in application code where you want to mark a part of UI as non-urgent and let it "lag behind" the rest of the UI.
1351
+
Both deferred values and [Transitions](#preventing-already-revealed-content-from-hiding) let you avoid showing Suspense fallback in favor of inline indicators. Transitions mark the whole update as non-urgent so they are typically used by frameworks and router libraries for navigation. Deferred values, on the other hand, are mostly useful in application code where you want to mark a part of UI as non-urgent and let it "lag behind" the rest of the UI.
1352
1352
1353
1353
</Note>
1354
1354
@@ -1727,7 +1727,7 @@ main {
1727
1727
1728
1728
When you pressed the button, the `Router` component rendered `ArtistPage` instead of `IndexPage`. A component inside `ArtistPage` suspended, so the closest Suspense boundary started showing the fallback. The closest Suspense boundary was near the root, so the whole site layout got replaced by `BigSpinner`.
1729
1729
1730
-
To prevent this, you can mark the navigation state update as a *transition* with [`startTransition`:](/reference/react/startTransition)
1730
+
To prevent this, you can mark the navigation state update as a *Transition* with [`startTransition`:](/reference/react/startTransition)
1731
1731
1732
1732
```js {5,7}
1733
1733
functionRouter() {
@@ -1741,7 +1741,7 @@ function Router() {
1741
1741
// ...
1742
1742
```
1743
1743
1744
-
This tells React that the state transition is not urgent, and it's better to keep showing the previous page instead of hiding any already revealed content. Now clicking the button "waits" for the `Biography` to load:
1744
+
This tells React that the state Transition is not urgent, and it's better to keep showing the previous page instead of hiding any already revealed content. Now clicking the button "waits" for the `Biography` to load:
1745
1745
1746
1746
<Sandpack>
1747
1747
@@ -2112,19 +2112,19 @@ main {
2112
2112
2113
2113
</Sandpack>
2114
2114
2115
-
A transition doesn't wait for *all* content to load. It only waits long enough to avoid hiding already revealed content. For example, the website `Layout` was already revealed, so it would be bad to hide it behind a loading spinner. However, the nested `Suspense` boundary around `Albums` is new, so the transition doesn't wait for it.
2115
+
A Transition doesn't wait for *all* content to load. It only waits long enough to avoid hiding already revealed content. For example, the website `Layout` was already revealed, so it would be bad to hide it behind a loading spinner. However, the nested `Suspense` boundary around `Albums` is new, so the Transition doesn't wait for it.
2116
2116
2117
2117
<Note>
2118
2118
2119
-
Suspense-enabled routers are expected to wrap the navigation updates into transitions by default.
2119
+
Suspense-enabled routers are expected to wrap the navigation updates into Transitions by default.
2120
2120
2121
2121
</Note>
2122
2122
2123
2123
---
2124
2124
2125
-
### Indicating that a transition is happening {/*indicating-that-a-transition-is-happening*/}
2125
+
### Indicating that a Transition is happening {/*indicating-that-a-transition-is-happening*/}
2126
2126
2127
-
In the above example, once you click the button, there is no visual indication that a navigation is in progress. To add an indicator, you can replace [`startTransition`](/reference/react/startTransition) with [`useTransition`](/reference/react/useTransition) which gives you a boolean `isPending` value. In the example below, it's used to change the website header styling while a transition is happening:
2127
+
In the above example, once you click the button, there is no visual indication that a navigation is in progress. To add an indicator, you can replace [`startTransition`](/reference/react/startTransition) with [`useTransition`](/reference/react/useTransition) which gives you a boolean `isPending` value. In the example below, it's used to change the website header styling while a Transition is happening:
2128
2128
2129
2129
<Sandpack>
2130
2130
@@ -2502,13 +2502,13 @@ main {
2502
2502
2503
2503
### Resetting Suspense boundaries on navigation {/*resetting-suspense-boundaries-on-navigation*/}
2504
2504
2505
-
During a transition, React will avoid hiding already revealed content. However, if you navigate to a route with different parameters, you might want to tell React it is *different* content. You can express this with a `key`:
2505
+
During a Transition, React will avoid hiding already revealed content. However, if you navigate to a route with different parameters, you might want to tell React it is *different* content. You can express this with a `key`:
2506
2506
2507
2507
```js
2508
2508
<ProfilePage key={queryParams.id} />
2509
2509
```
2510
2510
2511
-
Imagine you're navigating within a user's profile page, and something suspends. If that update is wrapped in a transition, it will not trigger the fallback for already visible content. That's the expected behavior.
2511
+
Imagine you're navigating within a user's profile page, and something suspends. If that update is wrapped in a Transition, it will not trigger the fallback for already visible content. That's the expected behavior.
2512
2512
2513
2513
However, now imagine you're navigating between two different user profiles. In that case, it makes sense to show the fallback. For example, one user's timeline is *different content* from another user's timeline. By specifying a `key`, you ensure that React treats different users' profiles as different components, and resets the Suspense boundaries during navigation. Suspense-integrated routers should do this automatically.
2514
2514
@@ -2545,7 +2545,7 @@ The server HTML will include the loading indicator. It will be replaced by the `
2545
2545
2546
2546
Replacing visible UI with a fallback creates a jarring user experience. This can happen when an update causes a component to suspend, and the nearest Suspense boundary is already showing content to the user.
2547
2547
2548
-
To prevent this from happening, [mark the update as non-urgent using `startTransition`](#preventing-already-revealed-content-from-hiding). During a transition, React will wait until enough data has loaded to prevent an unwanted fallback from appearing:
2548
+
To prevent this from happening, [mark the update as non-urgent using `startTransition`](#preventing-already-revealed-content-from-hiding). During a Transition, React will wait until enough data has loaded to prevent an unwanted fallback from appearing:
0 commit comments