useEffect1 [ReactJS] useEffect() 지난시간에 공부한 내용의 연장선상이지만, 리액트는 특정 원소가 변했을 때만 반응할 수 있게 우리를 도와준다. 다음 코드를 살펴보자 import { useState, useEffect } from "react"; function App() { const [counter, setValue] = useState(0); const [keyword, setKeyword] = useState("") const onClick = () => setValue((prev) => prev + 1); const onChange = (event) => setKeyword(event.target.value); console.log('I run all the time'); // useEffect helps us to call a .. 2023. 1. 11. 이전 1 다음