Hey Moralis community! I am trying to map through objects in my database to the front end in ReactJS, but I’m getting this error: TypeError: Cannot read properties of undefined (reading 'map')
When I console.log(className)
or console.log([className])
as an array, it’s logged in the console as undefined
. However, I have 3 objects that I’ve successfully uploaded to the Moralis db.
Is there something wrong with how I am mapping the objects?
{className.map((className) => (
<div>
<h1>
Info Here {className.id} by {className.createdBy} with {className.prop1} and {className.prop2 ? "yes" : "no"}
</h1>
</div>
))}