by ghusbands · 4y ago · 0 comments
\<h1>Hello, world!\</h1>
\<img alt="Hello, world!"/>
\<h1>Hello, {place}!\</h1>
\<img alt={message}/>
But this doesn't: \<img alt="Hello, {place}!"/>
And as other commenters note, it's designed around React internals, meaning you get rules around capitalisation that wouldn't otherwise exist. And so on. <img alt={"Hello, " + place}/>
Or, for more complex interpolation: <img alt={`Hello, ${place}`}/>