Study/ReactJS (1) 썸네일형 리스트형 React fetch API called 2 times on page load React JS를 공부하면서 fetch 요청이 두 번 가는 것을 확인 const getDetail = async () => { const json = await ( await fetch(`https://yts.mx/api/v2/movie_details.json?movie_id=${id}`) ).json(); setDetail(json.data.movie); setLoading(false); }; useEffect(() => { getDetail(); }, []); 코드에는 문제가 없는 것으로 파악 알고보니 developement mode 에서 빌드 + developement mode 에서 활성화되는 StrictMode 옵션 때문인 것이었다. 참고문헌 https://stackoverflow.com/ques.. 이전 1 다음