Skip to content

Commit b44e372

Browse files
authored
Merge pull request #714 from reactjs/sync-4f9e9a56
Sync with react.dev @ 4f9e9a5
2 parents 47b02d0 + abf6750 commit b44e372

17 files changed

+39
-32
lines changed

src/components/Layout/Feedback.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ const thumbsDownIcon = (
4545
);
4646

4747
function sendGAEvent(isPositive: boolean) {
48+
const category = isPositive ? 'like_button' : 'dislike_button';
49+
const value = isPositive ? 1 : 0;
4850
// Fragile. Don't change unless you've tested the network payload
4951
// and verified that the right events actually show up in GA.
5052
// @ts-ignore
5153
gtag('event', 'feedback', {
52-
event_category: 'button',
54+
event_category: category,
5355
event_label: window.location.pathname,
54-
value: isPositive ? 1 : 0,
56+
event_value: value,
5557
});
5658
}
5759

src/components/Layout/Sidebar/SidebarLink.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function SidebarLink({
7777
{title}{' '}
7878
{canary && (
7979
<IconCanary
80-
title="This feature is available in the latest Canary"
80+
title=" - This feature is available in the latest Canary"
8181
className="ms-2 text-gray-30 dark:text-gray-60 inline-block w-4 h-4 align-[-3px]"
8282
/>
8383
)}

src/components/MDX/MDXComponents.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function Illustration({
243243
src={src}
244244
alt={alt}
245245
style={{maxHeight: 300}}
246-
className="bg-white rounded-lg"
246+
className="rounded-lg"
247247
/>
248248
{caption ? (
249249
<figcaption className="text-center leading-tight mt-4">
@@ -275,7 +275,12 @@ function IllustrationBlock({
275275
const images = imageInfos.map((info, index) => (
276276
<figure key={index}>
277277
<div className="bg-white rounded-lg p-4 flex-1 flex xl:p-6 justify-center items-center my-4">
278-
<img src={info.src} alt={info.alt} height={info.height} />
278+
<img
279+
className="text-primary"
280+
src={info.src}
281+
alt={info.alt}
282+
height={info.height}
283+
/>
279284
</div>
280285
{info.caption ? (
281286
<figcaption className="text-secondary dark:text-secondary-dark text-center leading-tight mt-4">

src/components/PageHeading.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function PageHeading({
3434
{title}
3535
{canary && (
3636
<IconCanary
37-
title="This feature is available in the latest Canary"
37+
title=" - This feature is available in the latest Canary"
3838
className="ms-4 mt-1 text-gray-50 dark:text-gray-40 inline-block w-6 h-6 align-[-1px]"
3939
/>
4040
)}

src/content/blog/2022/03/29/react-v18.md

-1
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,3 @@ React 18 の strict モードでは、開発時にコンポーネントがマウ
339339
* Update webpack plugin for webpack 5 ([#22739](https://github.com/facebook/react/pull/22739) by [@michenly](https://github.com/michenly))
340340
* Fix a mistake in the Node loader. ([#22537](https://github.com/facebook/react/pull/22537) by [@btea](https://github.com/btea))
341341
* Use `globalThis` instead of `window` for edge environments. ([#22777](https://github.com/facebook/react/pull/22777) by [@huozhi](https://github.com/huozhi))
342-

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -642,5 +642,4 @@ React チームでは、[Rachel Nabors](https://twitter.com/rachelnabors/) が
642642

643643
アルファテスト及びベータテストプログラムに参加してくださった皆さんに心から感謝します。皆さんの情熱と貴重なフィードバックによって、このドキュメントを形作ることができました。そして React Conf 2021 で自身の経験をもとに React ドキュメントについて語っていただいた、ベータテスタの [Debbie O'Brien](https://twitter.com/debs_obrien) に特別な感謝を送ります。
644644

645-
最後に、この取り組みの背後にあるインスピレーションを与えてくださった React コミュニティに感謝します。これを行っているのは皆さんがいるからです。新しいドキュメントが、皆さんの望むどのようなユーザインターフェースであっても、それを React で構築する際の手助けとなれば幸いです。
646-
645+
最後に、この取り組みの背後にあるインスピレーションを与えてくださった React コミュニティに感謝します。これを行っているのは皆さんがいるからです。新しいドキュメントが、皆さんの望むどのようなユーザインターフェースであっても、それを React で構築する際の手助けとなれば幸いです。

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export default function Square() {
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

src/content/learn/typescript.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ type ComplexObject = {
299299
// The context is created with `| null` in the type, to accurately reflect the default value.
300300
const Context = createContext<ComplexObject | null>(null);
301301

302-
// The `| null` will be removed via the check in the hook.
302+
// The `| null` will be removed via the check in the Hook.
303303
const useGetComplexObject = () => {
304304
const object = useContext(Context);
305305
if (!object) { throw new Error("useGetComplexObject must be used within a Provider") }

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ export default function Search() {
9393

9494
### Handle form submission with a Server Action {/*handle-form-submission-with-a-server-action*/}
9595

96-
Render a `<form>` with an input and submit button. Pass a server action (a function marked with [`'use server'`](/reference/react/use-server)) to the `action` prop of form to run the function when the form is submitted.
96+
Render a `<form>` with an input and submit button. Pass a Server Action (a function marked with [`'use server'`](/reference/react/use-server)) to the `action` prop of form to run the function when the form is submitted.
9797

98-
Passing a server action to `<form action>` allow users to submit forms without JavaScript enabled or before the code has loaded. This is beneficial to users who have a slow connection, device, or have JavaScript disabled and is similar to the way forms work when a URL is passed to the `action` prop.
98+
Passing a Server Action to `<form action>` allow users to submit forms without JavaScript enabled or before the code has loaded. This is beneficial to users who have a slow connection, device, or have JavaScript disabled and is similar to the way forms work when a URL is passed to the `action` prop.
9999

100-
You can use hidden form fields to provide data to the `<form>`'s action. The server action will be called with the hidden form field data as an instance of [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
100+
You can use hidden form fields to provide data to the `<form>`'s action. The Server Action will be called with the hidden form field data as an instance of [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
101101

102102
```jsx
103103
import { updateCart } from './lib.js';

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

+4-4
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

@@ -51,7 +51,7 @@ function StatefulForm({}) {
5151

5252
The form state is the value returned by the action when the form was last submitted. If the form has not yet been submitted, it is the initial state that you pass.
5353

54-
If used with a server action, `useFormState` allows the server's response from submitting the form to be shown even before hydration has completed.
54+
If used with a Server Action, `useFormState` allows the server's response from submitting the form to be shown even before hydration has completed.
5555

5656
[See more examples below.](#usage)
5757

@@ -117,7 +117,7 @@ function action(currentState, formData) {
117117

118118
#### Display form errors {/*display-form-errors*/}
119119

120-
To display messages such as an error message or toast that's returned by a server action, wrap the action in a call to `useFormState`.
120+
To display messages such as an error message or toast that's returned by a Server Action, wrap the action in a call to `useFormState`.
121121

122122
<Sandpack>
123123

@@ -190,7 +190,7 @@ form button {
190190

191191
#### Display structured information after submitting a form {/*display-structured-information-after-submitting-a-form*/}
192192

193-
The return value from a server action can be any serializable value. For example, it could be an object that includes a boolean indicating whether the action was successful, an error message, or updated information.
193+
The return value from a Server Action can be any serializable value. For example, it could be an object that includes a boolean indicating whether the action was successful, an error message, or updated information.
194194

195195
<Sandpack>
196196

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@ title: React リファレンス概要
33
---
44

55
<Intro>
6-
このセクションは React で開発をする際の詳細なリファレンスドキュメントです。
7-
React の使い方の概要については [Learn](/learn) セクションをご覧ください。
6+
7+
このセクションは React で開発をする際の詳細なリファレンスドキュメントです。React の使い方の概要については [Learn](/learn) セクションをご覧ください。
8+
89
</Intro>
910

1011
React リファレンスは機能別にいくつかのサブセクションに分かれています。
1112

1213
## React {/*react*/}
14+
1315
プログラムから利用する React の機能です。
16+
1417
* [フック](/reference/react/hooks) - コンポーネント内から使用する様々な React の機能
1518
* [コンポーネント](/reference/react/components) - JSX 内で用いる組み込みコンポーネント
1619
* [API](/reference/react/apis) - コンポーネントの定義に用いる API
1720
* [ディレクティブ](/reference/react/directives) - React Server Components 互換のバンドラに与えるための指示情報
1821

1922
## React DOM {/*react-dom*/}
20-
React DOM には(ブラウザの DOM 環境で動作する)ウェブアプリケーションでのみ用いられる機能が含まれます。
21-
以下のセクションに分かれています。
23+
24+
React DOM には(ブラウザの DOM 環境で動作する)ウェブアプリケーションでのみ用いられる機能が含まれます。以下のセクションに分かれています。
2225

2326
* [フック](/reference/react-dom/hooks) - ブラウザの DOM 環境で実行されるウェブアプリケーションのためのフック
2427
* [コンポーネント](/reference/react-dom/components) - React がサポートする組み込みの HTML および SVG コンポーネント
@@ -27,4 +30,5 @@ React DOM には(ブラウザの DOM 環境で動作する)ウェブアプ
2730
* [サーバ API](/reference/react-dom/server) - サーバで React コンポーネントを HTML にレンダーするための `react-dom/server` API 群
2831

2932
## レガシー API {/*legacy-apis*/}
30-
* [レガシー API](/reference/react/legacy) - `react` パッケージからエクスポートされているが新しいコードでは使用が推奨されないもの
33+
34+
* [レガシー API](/reference/react/legacy) - `react` パッケージからエクスポートされているが新しいコードでは使用が推奨されないもの

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,4 @@ React アプリでは、一般的な UI パターンやロジックを処理す
376376

377377
ライブラリがサーバコンポーネントと互換性を有するように更新済みであれば、中に既に `'use client'` マーカが含まれていますので、サーバコンポーネントから直接使用することができます。ライブラリが更新されていない場合、あるいはコンポーネントが受け取る props にクライアントでのみ指定できるイベントハンドラのようなものが含まれている場合、サードパーティのクライアントコンポーネントとそれを使用したいサーバコンポーネントの間に、自分でクライアントコンポーネントファイルを追加する必要があるかもしれません。
378378

379-
[TODO]: <> (Troubleshooting - need use-cases)
379+
[TODO]: <> (Troubleshooting - need use-cases)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ canary: true
2525

2626
### `'use server'` {/*use-server*/}
2727

28-
非同期 (async) 関数の本体の冒頭に `'use server';` を追加することで、その関数がクライアントから実行可能であるとマークします。そのような関数のことを*サーバアクション (server action)* と呼びます。
28+
非同期 (async) 関数の本体の冒頭に `'use server';` を追加することで、その関数がクライアントから実行可能であるとマークします。そのような関数のことを*サーバアクション (Server Action)* と呼びます。
2929

3030
```js {2}
3131
async function addToCart(data) {

src/content/reference/react/useId.md

-1
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,3 @@ input { margin: 5px; }
302302
```
303303
304304
</Sandpack>
305-

src/content/reference/react/useOptimistic.md

+3-3
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

@@ -116,7 +116,7 @@ export default function App() {
116116
]);
117117
async function sendMessage(formData) {
118118
const sentMessage = await deliverMessage(formData.get("message"));
119-
setMessages([...messages, { text: sentMessage }]);
119+
setMessages((messages) => [...messages, { text: sentMessage }]);
120120
}
121121
return <Thread messages={messages} sendMessage={sendMessage} />;
122122
}

src/sidebarReference.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@
8282
},
8383
{
8484
"title": "useTransition",
85-
"path": "/reference/react/useTransition",
86-
"canary": true
85+
"path": "/reference/react/useTransition"
8786
}
8887
]
8988
},

0 commit comments

Comments
 (0)