Translate "useCallback" hook reference#591
Merged
koba04 merged 8 commits intoreactjs:mainfrom Jun 16, 2023
Merged
Conversation
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Member
|
ありがとうございます。次回以降 #452 で先に宣言していただけると助かります。 |
c41e694 to
de34623
Compare
Member
|
Markdown パースや textlint 絡みの問題があるので、
|
Member
|
すみません、偶然今エフェクト関係の記事を翻訳していて痛感したのですが、 一旦、こちらに書いた方針で見直しをお願いできないでしょうか。 useEffect リファレンスの翻訳をしていた時はこの辺をよく考えておらず、「オブジェクトの不要な依存関係を削除する」みたいな、今見返したら何を言っているのかピンと来ない翻訳を自分がしてしまっているのですが、こういうのも「オブジェクト型の不要な依存値を削除する」と具体的に言った方が良い気がしています。(そちらは #585 と併せてこちらで修正します) |
Member
Contributor
Author
|
Co-authored-by: Soichiro Miki <smiki-tky@umin.ac.jp>
seckie
commented
May 31, 2023
|
|
||
| If you're already familiar with [`useMemo`,](/reference/react/useMemo) you might find it helpful to think of `useCallback` as this: | ||
| * **`useCallback` は*関数自体*をキャッシュします**。`useMemo`とは異なり、あなたが提供する関数を呼び出しません。代わりに、あなたが提供した関数をキャッシュして、`productId` または `referrer` が変更されない限り、`handleSubmit` *自体*が変更されないようにします。これにより、`ShippingForm` を不必要に再レンダーすることなく、`handleSubmit` 関数を下位に渡すことができます。ユーザーがフォームを送信するまであなたのコードは実行されません。 | ||
|
|
Co-authored-by: Naoki Sekiguchi <likealunatic@gmail.com>
smikitky
approved these changes
Jun 1, 2023
Member
smikitky
left a comment
There was a problem hiding this comment.
提案はそのままコミットしておきました。ありがとうございました!
2 人のレビューが必要ですのでこのままお待ち頂ければ幸いです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#573 に引き続いて2つ目の翻訳です。