I am just starting out with javascript and typescript, and I need to generate a link based on certain variables. I am currently facing an issue trying to insert that link into
<a href="Some Link"> Some Text </a>
Both the "Some Text" and "Some Link" values are sourced from variables.
I have managed to fetch the "Some Text" from a variable
<dd><a href="{thisDoesNotWork}">{someText}</a></dd>
However, I am struggling to make the href attribute work with a variable string as it is being taken literally. How can I make the href work with a variable string?
Providing more context:
Current typescript code:
return (
<div>
....
<dd><a href="hardCodedSomething">{someText}</a></dd>
</div>
)
Desired behavior:
var someDynamicUrl = "somepath.com" + someId
return (
<div>
....
<dd><a href="someDynamicUrl">{someText}</a></dd>
</div>
)