Skip to content

Commit 47fe5a5

Browse files
authored
Merge branch 'main' into use-client
2 parents fa9e4ad + c5e3ae3 commit 47fe5a5

File tree

7 files changed

+81
-80
lines changed

7 files changed

+81
-80
lines changed

src/components/Layout/Feedback.tsx

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

4747
function sendGAEvent(isPositive: boolean) {
48+
const category = isPositive ? 'like_button' : 'dislike_button';
4849
const value = isPositive ? 1 : 0;
4950
// Fragile. Don't change unless you've tested the network payload
5051
// and verified that the right events actually show up in GA.
5152
// @ts-ignore
5253
gtag('event', 'feedback', {
53-
event_category: 'button',
54+
event_category: category,
5455
event_label: window.location.pathname,
55-
value,
56+
event_value: value,
5657
});
5758
}
5859

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/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/reference/react/index.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
---
2-
title: React Reference Overview
2+
title: React 参考总览
33
---
44

55
<Intro>
66

7-
This section provides detailed reference documentation for working with React. For an introduction to React, please visit the [Learn](/learn) section.
7+
本部分提供了使用 React 的详细参考文档。如果需要了解 React,请访问 [学习](/learn) 部分。
88

99
</Intro>
1010

11-
Our The React reference documentation is broken down into functional subsections:
11+
React 参考文档分为以下功能子部分:
1212

1313
## React {/*react*/}
1414

15-
Programmatic React features:
15+
编程式 React 功能:
1616

17-
* [Hooks](/reference/react/hooks) - Use different React features from your components.
18-
* [Components](/reference/react/components) - Documents built-in components that you can use in your JSX.
19-
* [APIs](/reference/react/apis) - APIs that are useful for defining components.
20-
* [Directives](/reference/react/directives) - Provide instructions to bundlers compatible with React Server Components.
17+
* [Hook](/reference/react/hooks) —— 在组件中使用不同的 React 特性。
18+
* [组件](/reference/react/components) —— 记录了可以在 JSX 中使用的内置组件。
19+
* [API](/reference/react/apis) —— 用于定义组件的有用 API。
20+
* [指令](/reference/react/directives) —— 为与 React 服务器组件兼容的捆绑器提供指示。
2121

2222
## React DOM {/*react-dom*/}
2323

24-
React-dom contains features that are only supported for web applications (which run in the browser DOM environment). This section is broken into the following:
24+
React-dom 仅支持在 web 应用程序中使用(在浏览器 DOM 环境中运行)。本节分为以下部分:
2525

26-
* [Hooks](/reference/react-dom/hooks) - Hooks for web applications which run in the browser DOM environment.
27-
* [Components](/reference/react-dom/components) - React supports all of the browser built-in HTML and SVG components.
28-
* [APIs](/reference/react-dom) - The `react-dom` package contains methods supported only in web applications.
29-
* [Client APIs](/reference/react-dom/client) - The `react-dom/client` APIs let you render React components on the client (in the browser).
30-
* [Server APIs](/reference/react-dom/server) - The `react-dom/server` APIs let you render React components to HTML on the server.
26+
* [Hook](/reference/react-dom/hooks) - 适用于在浏览器 DOM 环境中运行的 web 应用程序的 Hook。
27+
* [组件](/reference/react-dom/components) - React 支持所有内置的 HTML SVG 组件。
28+
* [API](/reference/react-dom) - `react-dom` 包含仅在 Web 应用程序中支持的方法。
29+
* [客户端 API](/reference/react-dom/client) - `react-dom/client` API 允许在客户端(浏览器中)呈现 React 组件。
30+
* [服务器 API](/reference/react-dom/server) - `react-dom/server` API 允许在服务器端将 React 组件渲染为 HTML
3131

32-
## Legacy APIs {/*legacy-apis*/}
32+
## 旧版 API {/*legacy-apis*/}
3333

34-
* [Legacy APIs](/reference/react/legacy) - Exported from the `react` package, but not recommended for use in newly written code.
34+
* [旧版 API](/reference/react/legacy) - react 包中导出,但不建议在新编写的代码中使用。

src/content/reference/react/useOptimistic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)