JavaScript
x
6
1
<Card className='my-3 p-3 rounded'>
2
<a href={'/product/${product._id}'}>
3
<Card.Img src={product.image} variant='top' />
4
</a>
5
</Card>
6
here i am posting my code i am getting the error while running npm start Unexpected template string expression no-template-curly-in-string
Advertisement
Answer
You should replace quotes (')
to a backtick quotes (`)
at your href inside <a>
tag like this.
Before:
<a href={'/product/${product._id}'}>
After:
<a href={`/product/${product._id}`}>
Here is link to eslint doc page for more information.