Answer the question
In order to leave comments, you need to log in
Fix TS typing error?
Deployed create-react-app with TS
There is a book prop that falls into components via typing book= BookParamsTypes[];
I don't transmit or use any more props.
export type BookParamsTypes = {
title: string;
pubDate?: number;
};
"JSX element type '{ book: BookParamsTypes[]; (Missing): any; }' is not a constructor function for JSX elements.
Type '{ book: BookParamsTypes[]; (Missing): any; }' is missing the following properties from type 'Element': type, props, keyts(2605)"
{book.map((item: any, i: number) => (
<Container key={i}>
<BookTitle>{item.title}</BookTitle>
// и так далее
}
</Container>
))}
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