Skip to content

Commit f3625fc

Browse files
authored
docs: fix some information in both Chinese and English (#7186)
1 parent 4d8614c commit f3625fc

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

packages/document/main-doc/docs/en/guides/basic-features/data/data-cache.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const getComplexStatistics = cache(
166166
}
167167
);
168168

169-
revalidateTag('dashboard-stats'); // Invalidates the cache for both getDashboardStats and getComplexStatistics functions
169+
revalidateTag('dashboard'); // Invalidates the cache for both getDashboardStats and getComplexStatistics functions
170170
```
171171

172172

packages/document/main-doc/docs/en/guides/basic-features/render/ssr.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ document.addEventListener('load', () => {
217217
export const doSomething = () => {}
218218
```
219219

220-
Directly referencing this in a component will cause CSR to throw errors, even if you use environment variables to conditionally load the code. The side effects in the dependency will still execute.
220+
Directly referencing this in a component will cause SSR to throw errors, even if you use environment variables to conditionally load the code. The side effects in the dependency will still execute.
221221

222222
```tsx title="routes/page.tsx"
223223
import { doSomething } from 'packageA';

packages/document/main-doc/docs/en/guides/basic-features/render/streaming-ssr.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Here, `user` is a Promise object representing asynchronously fetched data, proce
6868
Additionally, `defer` can receive both asynchronous and synchronous data. In the example below, short-duration requests are returned using object data, while longer-duration requests are returned using a Promise:
6969

7070
```ts title="user/[id]/page.data.ts"
71-
export const loader = ({ params }: LoaderFunctionArgs) => {
71+
export const loader = async ({ params }: LoaderFunctionArgs) => {
7272
const userId = params.id;
7373

7474
const user = new Promise<User>(resolve => {
@@ -227,4 +227,4 @@ import StreamSSRPerformance from '@site-docs-en/components/stream-ssr-performanc
227227
## Related Documentation
228228

229229
1. [Deferred Data](https://reactrouter.com/en/main/guides/deferred)
230-
2. [New Suspense SSR Architecture in React 18](https://github.com/reactwg/react-18/discussions/37)
230+
2. [New Suspense SSR Architecture in React 18](https://github.com/reactwg/react-18/discussions/37)

packages/document/main-doc/docs/en/guides/basic-features/static-assets/wasm-assets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WebAssembly (Wasm) is a portable, high-performance binary format designed to exe
1212

1313
## Import
1414

15-
You can import a WebAssembly module directly in a JavaScript file:
15+
You can import a WebAssembly module via named import in a JavaScript file:
1616

1717
```js title="index.js"
1818
import { add } from './add.wasm';

packages/document/main-doc/docs/zh/guides/basic-features/data/data-cache.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const getComplexStatistics = cache(
159159
}
160160
);
161161

162-
revalidateTag('dashboard-stats'); // 会使 getDashboardStats 函数和 getComplexStatistics 函数的缓存都失效
162+
revalidateTag('dashboard'); // 会使 getDashboardStats 函数和 getComplexStatistics 函数的缓存都失效
163163
```
164164

165165
#### `getKey` 参数

packages/document/main-doc/docs/zh/guides/basic-features/render/ssr.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ document.addEventListener('load', () => {
222222
export const doSomething = () => {}
223223
```
224224

225-
如果直接引用到组件中,会造成 CSR 加载报错,即使你已经使用环境变量进行判断,但仍然无法移除依赖中副作用的执行。
225+
如果直接引用到组件中,会造成 SSR 加载报错,即使你已经使用环境变量进行判断,但仍然无法移除依赖中副作用的执行。
226226

227227
```tsx title="routes/page.tsx"
228228
import { doSomething } from 'packageA';

packages/document/main-doc/docs/zh/guides/basic-features/render/streaming-ssr.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const loader = ({ params }: LoaderFunctionArgs) => {
7272
另外,`defer` 还可以同时接收异步数据和同步数据。在下述例子中,我们等待部分耗时较短的请求,在响应后通过对象数据返回,而耗时较长时间的请求,则通过 Promise 返回:
7373

7474
```ts title="user/[id]/page.data.ts"
75-
export const loader = ({ params }: LoaderFunctionArgs) => {
75+
export const loader = async ({ params }: LoaderFunctionArgs) => {
7676
const userId = params.id;
7777

7878
const user = new Promise<User>(resolve => {

packages/document/main-doc/docs/zh/guides/basic-features/static-assets/wasm-assets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WebAssembly(缩写为 wasm)是一种可移植、高性能的字节码格式
1212

1313
## 引用方式
1414

15-
你可以直接在 JavaScript 文件中引用一个 WebAssembly 模块:
15+
你可以在 JavaScript 文件中使用 named import 引用一个 WebAssembly 模块:
1616

1717
```js title="index.js"
1818
import { add } from './add.wasm';

0 commit comments

Comments
 (0)