9

I can use a double and single quote to concatenate my dynamic variable but template string is cleaner. I got an unexpected token, any clue why?

...
return (<UserList id={subactions} key=`applications${query.status}` />)
...
3
  • Please add a tag for your environment/framework. Commented Jun 8, 2017 at 5:02
  • would key={'applications'+query.status} work? Commented Jun 8, 2017 at 5:07
  • 5
    would key={`applications${query.status}`} work? Commented Jun 8, 2017 at 5:29

1 Answer 1

20

You need to change it to the code below.

return (<UserList id={subactions} key={ `applications${query.status}` } />)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.