I have an array of components, so I want to print the content. My attempt is like this:
const fields = [<Invites />]
return (
<Card style={{ width: 600 }}>
{fields.map((Item, index) => <Item />)}
</Card>
)
But, I got this error:
react-dom.development.js:28439 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
BTW, this is the <Invites /> component:
const Invites = () => {
return (
<Form.Item className='form-item item-container' label="Invites">
<span>
<Input />
</span>
</Form.Item>
)
}