프로젝트/쩝쩝박사 (2) 썸네일형 리스트형 20220415(금) MainContainer.tsx import React, { useState, useEffect } from 'react'; import SideBar from '../components/SideBar/SideBar'; import KakaoMap from '../KakaoMap/KakaoMap'; import styles from './MainContainer.module.scss' import { getYoutubeItems, getVideoStatistic, getVideoComments } from '../api/youtube' import { async } from '@firebase/util'; type thumbnailType = { height: number; url: string; wid.. [프로젝트/쩝쩝박사] MainContainer Error Uncaught Error: Too many re-renders. React limits the number of renders to prevent an infinite loop. return( ) 안에 함수를 작성할때 나타나는 오류. useEffect안에 작성해줘야 함 해결 안되는 것 1. useEffect의 두번째 파라미터로 loading_items를 넣으면 무한루프. 반복된 요청으로 유튜브 api할당량 초과로 403 ERROR useEffect(() => { setYoutubeItems(); // setVideoComments(); return (() => { console.log('컴포넌트 제거됨') }) }, [loading_items]) 2. 1번과 같은 오류 useEffect(() => { .. 이전 1 다음