Skip to content

Commit 79c6398

Browse files
authored
Merge pull request #32 from reactjs/sync-4f9e9a56
Sync with react.dev @ 4f9e9a5
2 parents 461d453 + 80db19c commit 79c6398

File tree

12 files changed

+16
-15
lines changed

12 files changed

+16
-15
lines changed

src/content/blog/2023/03/16/introducing-react-dev.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ export default function PackingList() {
428428

429429
Note that you must write `importance > 0 && ...` rather than `importance && ...` so that if the `importance` is `0`, `0` isn't rendered as the result!
430430

431-
In this solution, two separate conditions are used to insert a space between then name and the importance label. Alternatively, you could use a fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
431+
In this solution, two separate conditions are used to insert a space between then name and the importance label. Alternatively, you could use a Fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
432432

433433
</Solution>
434434

@@ -643,4 +643,3 @@ On the development front, thanks to [Jared Palmer](https://twitter.com/jaredpalm
643643
Huge thanks to the folks who volunteered their time to participate in the alpha and beta testing program. Your enthusiasm and invaluable feedback helped us shape these docs. A special shout out to our beta tester, [Debbie O'Brien](https://twitter.com/debs_obrien), who gave a talk about her experience using the React docs at React Conf 2021.
644644

645645
Finally, thanks to the React community for being the inspiration behind this effort. You are the reason we do this, and we hope that the new docs will help you use React to build any user interface that you want.
646-

src/content/community/versioning-policy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ In general, we *don't* bump the major version number for changes to:
4646

4747
* **Development warnings.** Since these don't affect production behavior, we may add new warnings or modify existing warnings in between major versions. In fact, this is what allows us to reliably warn about upcoming breaking changes.
4848
* **APIs starting with `unstable_`.** These are provided as experimental features whose APIs we are not yet confident in. By releasing these with an `unstable_` prefix, we can iterate faster and get to a stable API sooner.
49-
* **Alpha and canary versions of React.** We provide alpha versions of React as a way to test new features early, but we need the flexibility to make changes based on what we learn in the alpha period. If you use these versions, note that APIs may change before the stable release.
49+
* **Alpha and Canary versions of React.** We provide alpha versions of React as a way to test new features early, but we need the flexibility to make changes based on what we learn in the alpha period. If you use these versions, note that APIs may change before the stable release.
5050
* **Undocumented APIs and internal data structures.** If you access internal property names like `__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED` or `__reactInternalInstance$uk43rzhitjg`, there is no warranty. You are on your own.
5151

5252
This policy is designed to be pragmatic: certainly, we don't want to cause headaches for you. If we bumped the major version for all of these changes, we would end up releasing more major versions and ultimately causing more versioning pain for the community. It would also mean that we can't make progress in improving React as fast as we'd like.

src/content/learn/conditional-rendering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ export default function PackingList() {
626626
627627
Note that you must write `importance > 0 && ...` rather than `importance && ...` so that if the `importance` is `0`, `0` isn't rendered as the result!
628628
629-
In this solution, two separate conditions are used to insert a space between the name and the importance label. Alternatively, you could use a fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
629+
In this solution, two separate conditions are used to insert a space between the name and the importance label. Alternatively, you could use a Fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
630630
631631
</Solution>
632632

src/content/learn/rendering-lists.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ hr {
11451145

11461146
<Hint>
11471147

1148-
You'll either need to convert `map` to a manual loop, or use a fragment.
1148+
You'll either need to convert `map` to a manual loop, or use a Fragment.
11491149

11501150
</Hint>
11511151

@@ -1208,7 +1208,7 @@ hr {
12081208

12091209
Using the original line index as a `key` doesn't work anymore because each separator and paragraph are now in the same array. However, you can give each of them a distinct key using a suffix, e.g. `key={i + '-text'}`.
12101210

1211-
Alternatively, you could render a collection of fragments which contain `<hr />` and `<p>...</p>`. However, the `<>...</>` shorthand syntax doesn't support passing keys, so you'd have to write `<Fragment>` explicitly:
1211+
Alternatively, you could render a collection of Fragments which contain `<hr />` and `<p>...</p>`. However, the `<>...</>` shorthand syntax doesn't support passing keys, so you'd have to write `<Fragment>` explicitly:
12121212

12131213
<Sandpack>
12141214

@@ -1254,7 +1254,7 @@ hr {
12541254

12551255
</Sandpack>
12561256

1257-
Remember, fragments (often written as `<> </>`) let you group JSX nodes without adding extra `<div>`s!
1257+
Remember, Fragments (often written as `<> </>`) let you group JSX nodes without adding extra `<div>`s!
12581258

12591259
</Solution>
12601260

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ You'll get this error:
362362

363363
<ConsoleBlock level="error">
364364

365-
/src/App.js: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment `<>...</>`?
365+
/src/App.js: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX Fragment `<>...</>`?
366366

367367
</ConsoleBlock>
368368

369-
React components need to return a single JSX element and not multiple adjacent JSX elements like two buttons. To fix this you can use *fragments* (`<>` and `</>`) to wrap multiple adjacent JSX elements like this:
369+
React components need to return a single JSX element and not multiple adjacent JSX elements like two buttons. To fix this you can use *Fragments* (`<>` and `</>`) to wrap multiple adjacent JSX elements like this:
370370

371371
```js {3-6}
372372
export default function Square() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To display an input, render the [built-in browser `<input>`](https://developer.m
3434

3535
<Canary>
3636

37-
React's extensions to the `formAction` prop are currently only available in React's canary and experimental channels. In stable releases of React `formAction` works only as a [built-in browser HTML component](https://react.dev/reference/react-dom/components#all-html-components). Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
37+
React's extensions to the `formAction` prop are currently only available in React's Canary and experimental channels. In stable releases of React `formAction` works only as a [built-in browser HTML component]
3838
</Canary>
3939

4040
[`formAction`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formaction): A string or function. Overrides the parent `<form action>` for `type="submit"` and `type="image"`. When a URL is passed to `action` the form will behave like a standard HTML form. When a function is passed to `formAction` the function will handle the form submission. See [`<form action>`](/reference/react-dom/components/form#props).

src/content/reference/react-dom/hooks/useFormState.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ canary: true
55

66
<Canary>
77

8-
The `useFormState` Hook is currently only available in React's canary and experimental channels. Learn more about [release channels here](/community/versioning-policy#all-release-channels). In addition, you need to use a framework that supports [React Server Components](/reference/react/use-client) to get the full benefit of `useFormState`.
8+
The `useFormState` Hook is currently only available in React's Canary and experimental channels. Learn more about [release channels here](/community/versioning-policy#all-release-channels). In addition, you need to use a framework that supports [React Server Components](/reference/react/use-client) to get the full benefit of `useFormState`.
99

1010
</Canary>
1111

src/content/reference/react-dom/hooks/useFormStatus.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ canary: true
55

66
<Canary>
77

8-
The `useFormStatus` Hook 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+
The `useFormStatus` Hook 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).
99

1010
</Canary>
1111

src/content/reference/react/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: React Reference Overview
33
---
44

55
<Intro>
6+
67
This section provides detailed reference documentation for working with React. For an introduction to React, please visit the [Learn](/learn) section.
78

89
</Intro>

src/content/reference/react/use-server.md

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Note that like most Hooks, `useFormState` can only be called in <CodeStep step={
175175

176176
Server Actions are exposed server endpoints and can be called anywhere in client code.
177177

178+
When using a Server Action outside of a [form](/reference/react-dom/components/form), call the Server Action in a [transition](/reference/react/useTransition), which allows you to display a loading indicator, show [optimistic state updates](/reference/react/useOptimistic), and handle unexpected errors. Forms will automatically wrap Server Actions in transitions.
178179
```js {9-12}
179180
import incrementLike from './actions';
180181
import { useState, useTransition } from 'react';

src/content/reference/react/use.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ canary: true
55

66
<Canary>
77

8-
The `use` Hook 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+
The `use` Hook 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).
99

1010
</Canary>
1111

src/content/reference/react/useOptimistic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ canary: true
55

66
<Canary>
77

8-
The `useOptimistic` Hook 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+
The `useOptimistic` Hook 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).
99

1010
</Canary>
1111

@@ -27,7 +27,7 @@ The `useOptimistic` Hook is currently only available in React's canary and exper
2727

2828
### `useOptimistic(state, updateFn)` {/*use*/}
2929

30-
`useOptimistic` is a React hook that lets you show a different state while an async action is underway. It accepts some state as an argument and returns a copy of that state that can be different during the duration of an async action such as a network request. You provide a function that takes the current state and the input to the action, and returns the optimistic state to be used while the action is pending.
30+
`useOptimistic` is a React Hook that lets you show a different state while an async action is underway. It accepts some state as an argument and returns a copy of that state that can be different during the duration of an async action such as a network request. You provide a function that takes the current state and the input to the action, and returns the optimistic state to be used while the action is pending.
3131

3232
This state is called the "optimistic" state because it is usually used to immediately present the user with the result of performing an action, even though the action actually takes time to complete.
3333

0 commit comments

Comments
 (0)