2) React Query
1. Intro
const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
useEffect(() => {
setLoading(true);
fetch("/api/users")
.then(res => res.json())
.then(setData)
.catch(() => setError("에러 발생"))
.finally(() => setLoading(false));
}, []);2. React Query
기능
설명
3. React Query 동작 흐름

4. 사용방법
Last updated