Community

개발자 99% 커뮤니티에서 수다 떨어요!

← Go back
도와주세요!
#react
2년 전
7,519
6

ReactJS로 영화 웹 서비스 만들기 수강중입니다!

현재 #7.3 강의 내용 중에서

import { useEffect, useState } from "react";        
function App(){
    const [loading, setLoading] = useState(true);
    // cosnt [movies, setMovies] = useState([]);
     useEffect(() => {
        fetch(
            `https://yts.mx/api/v2/list_movies.json?minimum_rating=8.8&sort_by=year`
            ).then((response) => response.json)
            .then((json) => console.log(json)); 
    },[]);
    return (
        <div>
            {loading ? <h1>Loading...</h1> : null}
        </div>
        );
} 
export default App;

이렇게 입력했는데, 콘솔창에 object가 뜨지 않고

ƒ json() { [native code] }

이것만 뜹니다ㅠㅠㅠ 혹시 이유 알 수 있을까요...?

6 comments