Skip to content Skip to sidebar Skip to footer

Unexpected Template String Expression

I learn from tutorial and want to make ProductScreen.js and Product.js and I became this warnings, what is the problem? product.js import React from 'react' import Rating from './R

Solution 1:

You are using JS template literals wrong. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals.

What you want is:

`/product/${product._id}`// and`/product/${product._id`// Note the backticks "`" instead of single quote marks "'"

Solution 2:

As I see you are using incorrect quotes in templates. There must be `

Post a Comment for "Unexpected Template String Expression"