#Jsx not rendering
29 messages · Page 1 of 1 (latest)
Can you share a code snippet? It's impossible to help you otherwise
It should work for sure 🤔, are you in an Astro component?
Yeah
oooooh I know! A matter of a fews characters 🥲
It works all right when it use isolated
{
data.map(e => <Stats {...e} />)
}
I made it really short here but you could still pass props manually
basically you were calling inside a function, and not returning it
xd glad it worked!
Please can you elaborate it for me
For sure!
I don’t want to commit that mistake again
basically what you did was equivalent to the following
data.map(data => {
const unusedVar = <Stats ... />
})
So you're not returning anything
However you could just update it to
data.map(data => {
return <Stats ... />
})
I just made it more compact earlier by spreading props
Does it make sense?
Not really, I’m trying to understand it
for jsx to show your component, the map function must return something right?
but the way you called your component, you were missing the return keyword
ahah a pleasure! Feel free to open another support thread if needed! 