score:3

Accepted answer
const addMovie = evt => {
    evt.preventDefault();
    setMovies(prevMovies => [
      ...prevMovies,
      { title: name, overview: "OK", id: movies.length + 1 } // <--- Here was previously `name` instead of `title`
    ]);
};

score:1

const addMovie = evt => {
 evt.preventDefault();
 setMovies(prevMovies => [
   ...prevMovies,
   { title: name, overview: "OK", id: movies.length + 1 }
 ]);
};

Related Query

More Query from same tag