Why do I get this error? `Error: result.map is not a function`

Here is my code:

import { use } from "react";
import { TMovie } from "../api/movies/types/MovieTypes";
import { MovieCard } from "./MovieCard";

export default function MovieList({
  moviePromise,
}: {
  moviePromise: Promise<TMovie[]>;
}) {
  const result = use(moviePromise) as TMovie[];

  console.log(result);
  return (
    <div>
      {result.map((results, id) => (
        <MovieCard key={id} results={results.results} />
      ))}
    </div>
  );
} 

js
Was this page helpful?