인프런 커뮤니티 질문&답변
React Hook useEffect has a missing dependency:
작성
·
427
0
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세
import React, { useEffect } from "react";
import axios from "../api/axios";
import "./Row.css";
export default function Row({isLargeLow, title, id, fetchUrl}) {
useEffect(() => {
fetchMovieData();
}, [])
const fetchMovieData = async () => {
const request = await axios.get(fetchUrl)
console.log("requeset",request)
}
return (
<div>Row</div>
)
}
Compiled with warnings.
[eslint]
src\components\Row.js
Line 15:4: React Hook useEffect has a missing dependency: 'fetchMovieData'. Either include it or remove the dependency array react-hooks/exhaustive-deps
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
WARNING in [eslint]
src\components\Row.js
Line 15:4: React Hook useEffect has a missing dependency: 'fetchMovieData'. Either include it or remove the dependency array react-hooks/exhaustive-deps
webpack compiled with 1 warning
이런식으로 계속 ueseffect 의존성 오류가 나오는데 ㅜㅜ 강의랑 똑같이해도 진행이 안되네요ㅠㅠㅠㅠㅠㅠ
답변
답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!




