Skip to content

Commit

Permalink
Merge branch 'main' into use-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Yucohny authored Nov 13, 2023
2 parents fa9e4ad + c5e3ae3 commit 47fe5a5
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 80 deletions.
5 changes: 3 additions & 2 deletions src/components/Layout/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ const thumbsDownIcon = (
);

function sendGAEvent(isPositive: boolean) {
const category = isPositive ? 'like_button' : 'dislike_button';
const value = isPositive ? 1 : 0;
// Fragile. Don't change unless you've tested the network payload
// and verified that the right events actually show up in GA.
// @ts-ignore
gtag('event', 'feedback', {
event_category: 'button',
event_category: category,
event_label: window.location.pathname,
value,
event_value: value,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Sidebar/SidebarLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function SidebarLink({
{title}{' '}
{canary && (
<IconCanary
title="This feature is available in the latest Canary"
title=" - This feature is available in the latest Canary"
className="ms-2 text-gray-30 dark:text-gray-60 inline-block w-4 h-4 align-[-3px]"
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function PageHeading({
{title}
{canary && (
<IconCanary
title="This feature is available in the latest Canary"
title=" - This feature is available in the latest Canary"
className="ms-4 mt-1 text-gray-50 dark:text-gray-40 inline-block w-6 h-6 align-[-1px]"
/>
)}
Expand Down
32 changes: 16 additions & 16 deletions src/content/reference/react/index.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
title: React Reference Overview
title: React 参考总览
---

<Intro>

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

</Intro>

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

## React {/*react*/}

Programmatic React features:
编程式 React 功能:

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

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

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:
React-dom 仅支持在 web 应用程序中使用(在浏览器 DOM 环境中运行)。本节分为以下部分:

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

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

* [Legacy APIs](/reference/react/legacy) - Exported from the `react` package, but not recommended for use in newly written code.
* [旧版 API](/reference/react/legacy) - react 包中导出,但不建议在新编写的代码中使用。
2 changes: 1 addition & 1 deletion src/content/reference/react/useOptimistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function App() {
]);
async function sendMessage(formData) {
const sentMessage = await deliverMessage(formData.get("message"));
setMessages([...messages, { text: sentMessage }]);
setMessages((messages) => [...messages, { text: sentMessage }]);
}
return <Thread messages={messages} sendMessage={sendMessage} />;
}
Expand Down
Loading

0 comments on commit 47fe5a5

Please sign in to comment.