#String interpolation within mdx jsx
4 messages · Page 1 of 1 (latest)
You have to use backticks and add a dollar sign $ in front of your brackets```jsx
<ul>
{
frontmatter.chapters.map((c, i) => (
<li><a href=/chapters/${i}>{c}, {i}</a></li>
))
}
</ul>
I’m not at my desk – pretty sure I tried that. Thank you for taking a look - back to you in bit
Oops I forgot the interpolation has to be in brackets like this ```jsx
<ul>
{
frontmatter.chapters.map((c, i) => (
<li><a href={/chapters/${i}}>{c}, {i}</a></li>
))
}
</ul>