Hello. I’m trying to pass an array of objects to my array component but I get the error saying that I’m trying to pass an object. Here’s the code:
let array = [
{ item: "Hello", key: 1 },
{ item: "Hello2", key: 2 },
];
const primary = (args) => {
return <Select>{array}</Select>;
};
And I get this:
Objects are not valid as a React child (found: object with keys {item, key}). If you meant to render a collection of children, use an array instead.