0

The type of the array of objects looks as follows: MyType: { name: string, age: number }[], props type in component is the same

./Parent.jsx
export const Parent = () => {
  return (
    <Content data={arrOfObj} />
  )
}

./Content.jsx

export const Content: React.FC<MyType> = (data) => {...}
Lust
  • 188
  • 1
  • 1
  • 8

1 Answers1

0

This is probably what you wanted

<Content data={arrOfObj} /> // warning

const Content: React.FC<{ data: MyType }> = ({ data }) => {...}
Konrad
  • 21,590
  • 4
  • 28
  • 64