Is there a way to define a function returning JSX inline (such as in the Astro frontmatter)?
I have a data which I map over to create elements but I split this data into two halves first. So I want to define the map function in the file once and use it like this for example:
---
function render(data) {
return (<div>...</div>)
}
---
<div>
{firstHalf.map(render)}
</div>
<div>
{secondHalf.map(render)}
</div>
This doesn't work so I am wondering what options I have other than moving it into another Astro component.