Please help me. I don\'t know why this piece of code doesn\'t work.
It gives me an error: \"Objects are not valid as a React child (found: object with keys {itemss})
You need to wrap items
in JSX in your return statement:
return (
{items}
)
Your final return statement currently is not inside JSX. It's plain old JavaScript that is constructing an object like {items: items}
thanks to enhanced object literals, which is why React is saying you are giving it an item with key items
.