タグ

ブックマーク / alexsidorenko.com (1)

  • A Visual Guide to useEffect

    Here is what happens when you try to fetch data directly from the body of a functional component in React 👇 Why does this happen and what tools does React offer to solve this problem? Side effects If your React component affects anything outside of itself, it’s called a side effect. Side effects shouldn’t happen during component render. Therefore they do not belong to the body of a functional com

    A Visual Guide to useEffect
    kako-jun
    kako-jun 2022/01/14
    useEffectやuseCallbackに第2引数として渡して、監視させる変数の話。第1引数で渡す関数内に、もし親から来たpropsやuseStateで作った変数が登場してれば、それらを指定すればいい、って覚えるとシンプル
  • 1