diff --git a/src/content/reference/react/useSyncExternalStore.md b/src/content/reference/react/useSyncExternalStore.md
index e44e9d3a2d..84e3c37428 100644
--- a/src/content/reference/react/useSyncExternalStore.md
+++ b/src/content/reference/react/useSyncExternalStore.md
@@ -69,10 +69,10 @@ function TodosApp() {
function ShoppingApp() {
const selectedProductId = useSyncExternalStore(...);
- // ❌ Calling `use` with a Promise dependent on `selectedProductId`
+ // ❌ 使用依赖于 `selectedProductId` 的 Promise 调用 `use`
const data = use(fetchItem(selectedProductId))
- // ❌ Conditionally rendering a lazy component based on `selectedProductId`
+ // ❌ 根据 `selectedProductId` 有条件地渲染懒组件
return selectedProductId != null ? : ;
}
```
@@ -119,7 +119,7 @@ export default function TodosApp() {
const todos = useSyncExternalStore(todosStore.subscribe, todosStore.getSnapshot);
return (
<>
-
+
{todos.map(todo => (
@@ -220,7 +220,7 @@ import { useSyncExternalStore } from 'react';
export default function ChatIndicator() {
const isOnline = useSyncExternalStore(subscribe, getSnapshot);
- return {isOnline ? '✅ Online' : '❌ Disconnected'}
;
+ return {isOnline ? '✅ 在线' : '❌ 离线'}
;
}
function getSnapshot() {
@@ -273,19 +273,19 @@ import { useOnlineStatus } from './useOnlineStatus.js';
function StatusBar() {
const isOnline = useOnlineStatus();
- return {isOnline ? '✅ Online' : '❌ Disconnected'}
;
+ return {isOnline ? '✅ 在线' : '❌ 离线'}
;
}
function SaveButton() {
const isOnline = useOnlineStatus();
function handleSaveClick() {
- console.log('✅ Progress saved');
+ console.log('✅ 保存的进度');
}
return (
);
}