#Too many closures?

3 messages · Page 1 of 1 (latest)

high lagoon
#

why is this invalid astro syntax? Is there a limit to the number of closures you can use?

{Array.isArray(user.reservations) && user.reservations.length > 0 ? (<table><tr><th>Location</th>{user.reservations.map(reservation => <td>{reservation.location}</td>)}</tr></table>) : "You have no active reservations"}

I'm trying to conditionally render either a table or a message, and then if I am rendering the table iteratively map an array of objects into some HTML basically
I think I might be tired but it seems to me the syntax is relatively well formed

high lagoon
#

welp I put it inside a Solidjs component and it worked

tacit parcel
#

did the same test as you and it seems like valid syntax. it might be a bug in astro. maybe an issue can be open ?