๋ฐ์ํ ๋ฆฌ์กํธ1 React) useEffect์ ๋ํด ์์๋ณด์ React๋ฅผ ๋ค์ ๋ณต์ต ์ค์ ํ๋ฒ ์ ๋ฆฌ๊ฐ ํ์ํ ๊ฒ ๊ฐ์์ ๊ธ์ ์จ ๋ณด๋ ค ํ๋ค. const App = () => { const [count, setCount] = useState(0); console.log("rendering"); const add = () => { console.log("add"); setCount(current => { return current+1 }); }; const minus = () => { console.log("minus"); setCount(current => { return current-1 }); }; useEffect(() => { console.log("component render"); return () => { console.log("component end.. 2021. 10. 6. ์ด์ 1 ๋ค์ ๋ฐ์ํ