import { useEffect, useState } from 'react' import './App.css' function App() { const API_MOVIE_KEY = import.meta.env.VITE_MOVIE_API_KEY const [movies, setMovies] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { fetch(`http://www.omdbapi.com/?apikey=${API_MOVIE_KEY}&s=batman`) .then((response) => response.json()) .then((data) => { setMovies(data.Search) }) .then(() => setLoading(false)) .catch((error) => console.log(error)) }, []) return ( <>