Answer the question
In order to leave comments, you need to log in
How to tell typescript that I am waiting for an object with the required fields in jsx?
My current code is
My type:
export interface IFilm {
id : number;
media_type : string;
overview : string;
poster_path : string;
release_date : string;
title : string;
vote_average : number;
vote_count : number;
}
export const Film = (film: IFilm): ReactElement => {
return <div></div>;
};
<Film film={film} />
backdrop_path: "/8Y43POKjjKDGI9MH89NW0NAzzp8.jpg"
id: 550988
media_type: "movie"
original_language: "en"
original_title: "Free Guy"
overview: "У сотрудник..."
popularity: 2165.83
poster_path: "/qJZ3UeKAOgz2kFVJPZZFzLtn1Qk.jpg"
release_date: "2021-08-11"
title: "Главный герой"
Type "{ film: IFilm; }" cannot be assigned to type "IntrinsicAttributes & IFilm".
Property 'film' does not exist on type 'IntrinsicAttributes & IFilm'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question