everytime I code like this ${row.name}, I get this error " Unexpected template string expression".
Any help?
23 Answers
ES6 template strings should be used with backquotes, not single quotes. Replace this :
'delete the item ${row.name}' With this :
`delete the item ${row.name}` And here is the ESLint example as requested in the comments :
0If you are not using an ES6 template string and actually want the dollar sign to print to the screen, place the following above the string declaration.
/* eslint-disable no-template-curly-in-string */ Sometimes its necessary to use templating characters within string, like inside anchor tags, etc.
'<a href="${' + 'OrganizationInfo.PrivacyPolicy}" target="_blank" >Privacy Policy</a>' Breaking the string worked for me.
