리액트 클린업
[React] Hook Flow 이해하기 2 :: App - Child, Clean-up
[React] Hook Flow 이해하기 2 :: App - Child, Clean-up
2021.09.14🎯 Hook Flow 이해하기 2 :: App - Child, Clean-up 훅의 호출 타이밍을 알아보자! 📝 Hook의 호출 타이밍 - Clean-up 타이밍에 집중해서 const rootElement = document.getElementById('root'); const Child = () => { console.log(" Child render start"); const [text, setText] = React.useState(() => { console.log(" Child useState"); return ""; }); React.useEffect(() => { console.log(" Child useEffect, no deps"); return () => { console.log(" C..