Why am I getting the error map is not a function

\\import React, { useState, useEffect } from 'react'

const  GetMovie = ()=> {
  const [movies, setMovie] = useState([])


  useEffect(() => {
    fetch(`https://movie-database-imdb-alternative.p.rapidapi.com/?i=tt4154796&r=json`,
      {
      headers: ({
        "x-rapidapi-host": "movie-database-imdb-alternative.p.rapidapi.com",
        "x-rapidapi-key": "59b107254bmshc8d75c6cfb204d5p11148ejsnd3da153ac53e"
      })
    })
      .then(response => response.json())
      .then(response => {       
        setMovie(response)
    })
  },[])
 
  return (
    <div>
      <ul>
     {movies.map(item => (<li>{item}</li>))}
     </ul>
    </div>
  )
}

When I console.log movies I get an object but I can’t loop over it using map.

map is an array method, if movies is an object then you can’t use map

You are not set movie value like an array.

Example :

setMovie([response])

Thanks. That was the correct solution.