(title)
| 9 | const [movies, setMovies] = useState([]); |
| 10 | const [searchTerm, setSearchTerm] = useState(""); |
| 11 | const searchMovies = async (title) => { |
| 12 | const response = await fetch(`${API_URL}&s=${title}`); |
| 13 | const data = await response.json(); |
| 14 | setMovies(data.Search); |
| 15 | }; |
| 16 | |
| 17 | useEffect(() => { |
| 18 | searchMovies("Batman"); |