Translate "Synchronizing with Effects" by smikitky · Pull Request #594 · reactjs/ja.react.dev

Conversation

@smikitky

Synchronizing with Effects 翻訳です

@github-actions

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! 🙌

smikitky

<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" は原文のミスくさいので訳してありません

koba04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!!!

2 participants

@smikitky @koba04