Translate "Synchronizing with Effects" by smikitky · Pull Request #594 · reactjs/ja.react.dev
Conversation
Size changes
Details
📦 Next.js Bundle Analysis for react-dev
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌
| <Solution> | ||
|
|
||
| Put the conditional logic inside the Effect. You will need to specify `shouldFocus` as a dependency because you are using it inside the Effect. (This means that if some input's `shouldFocus` changes from `false` to `true`, it will focus after mount.) | ||
| 条件付きのロジックはエフェクトの中に入れます。エフェクトの中で `shouldFocus` を使用しているため、依存関係として `shouldFocus` を指定する必要があります。(これは、ある入力欄の `shouldFocus` が `false` から `true` に変わった場合、フォーカスが当たるということでもあります。) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"after mount" は原文のミスくさいので訳してありません
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!!!
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