import React, { useEffect, useState } from "react";
const App = () => {
const [films, setFilms] = useState([]);
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": "ceff3505-c77c-450a-8abb-aa29f638f5ee"
}
}
);
const result = await response.json();
setFilms(result);
console.log(films);
};
useEffect(() => {Fetch();}, [films]);
return <div></div>;
};
export default App;
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Rubik&display=swap" rel="stylesheet"></link>
[[PromiseResult]]: "https://lastfm.freetls.fastly.net/i/u/300x300/78dbc331c86c65637ae61d509beb4e04.png"