Skip to content

Commit 35b29c4

Browse files
committed
Translate preserve-manual-memoization lint rule
1 parent 37a7f80 commit 35b29c4

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎src/content/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ title: preserve-manual-memoization
44

55
<Intro>
66

7-
Validates that existing manual memoization is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo).
7+
既存の手動メモ化がコンパイラによって保持されるか検証します。React Compiler は、その推論結果が[既存の手動メモ化と同等以上である](/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)場合にのみ、コンポーネントやフックをコンパイルします。
88

99
</Intro>
1010

11-
## Rule Details {/*rule-details*/}
11+
## ルールの詳細 {/*rule-details*/}
1212

13-
React Compiler preserves your existing `useMemo`, `useCallback`, and `React.memo` calls. If you've manually memoized something, the compiler assumes you had a good reason and won't remove it. However, incomplete dependencies prevent the compiler from understanding your code's data flow and applying further optimizations.
13+
React Compiler は、既存の `useMemo`、`useCallback`、`React.memo` の呼び出しを保持します。手動でメモ化しているものがあれば、コンパイラはそれに十分な理由があるとみなし、削除しません。ただし、依存値が不足していると、コンパイラがコードのデータフローを理解して、さらなる最適化を適用することができなくなります。
1414

15-
### Invalid {/*invalid*/}
15+
### 無効な例 {/*invalid*/}
1616

17-
Examples of incorrect code for this rule:
17+
このルールに違反するコードの例です。
1818

1919
```js
2020
// ❌ Missing dependencies in useMemo
@@ -37,9 +37,9 @@ function Component({ onUpdate, value }) {
3737
}
3838
```
3939

40-
### Valid {/*valid*/}
40+
### 有効な例 {/*valid*/}
4141

42-
Examples of correct code for this rule:
42+
このルールに従ったコードの例です。
4343

4444
```js
4545
// ✅ Complete dependencies
@@ -60,11 +60,11 @@ function Component({ data, filter }) {
6060
}
6161
```
6262

63-
## Troubleshooting {/*troubleshooting*/}
63+
## トラブルシューティング {/*troubleshooting*/}
6464

65-
### Should I remove my manual memoization? {/*remove-manual-memoization*/}
65+
### 手動のメモ化は削除するべきか? {/*remove-manual-memoization*/}
6666

67-
You might wonder if React Compiler makes manual memoization unnecessary:
67+
以下のような手動のメモ化は、React Compiler を使えば不要になるのかと思うかもしれません。
6868

6969
```js
7070
// Do I still need this?
@@ -79,7 +79,7 @@ function Component({items, sortBy}) {
7979
}
8080
```
8181

82-
You can safely remove it if using React Compiler:
82+
React Compiler を使っているなら、安全に削除できます。
8383

8484
```js
8585
// ✅ Better: Let the compiler optimize

0 commit comments

Comments
 (0)