import React, { useEffect, useState } from "react";
const App = () => {
const [films, setFilms] = useState([]);
useEffect(() => {
const Fetch = async () => {
const response = await fetch(
"https://kinopoiskapiunofficial.tech/api/v2.2/films/top?type=TOP_AWAIT_FILMS&page=1",
{
headers: {
"X-API-KEY": "i'm sorry :)"
}
}
);
const result = await response.json();
setFilms(result);
console.log(films);
};
Fetch();
}, [films]);
return <div></div>;
};
export default App;