<Link to={'${oldUrl}/${id}'} >
Hi, I am using template literal in a react app link tag and it is showing below error message please tell if anyone knows how to add it correctly?
Unexpected template string expression no-template-curly-in-string
<Link to={'${oldUrl}/${id}'} >
Hi, I am using template literal in a react app link tag and it is showing below error message please tell if anyone knows how to add it correctly?
Unexpected template string expression no-template-curly-in-string
Change your code to this
<Link to={`${oldUrl}/${id}`} >
And it should clear the error
Use backticks (`) for template literals, not quotes (') :
<Link to={`${oldUrl}/${id}`} >