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
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
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server