React + Typescript: Property * is missing in type *
comment.tsx(30,5): error TS2324: Property 'data' is missing in type 'MyProps'. comment.tsx(31,5): error TS2324: Property 'data' is missing in type 'MyProps'. main.tsx(20,17): error TS2324: Property 'author' is missing in type 'MyProps'. main.tsx(27,18): error TS2324: Property 'author' is missing in type 'MyProps'.
You are probably confusing MyProps
for CommentList
(does not contain .author
) and MyProps
for Comment
(does not contain .data
).
Better if you use different Prop interfaces for the two components.