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}` />)
...
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}` />)
...
Share
Improve this question
edited Dec 28, 2024 at 1:18
Penny Liu
17.4k5 gold badges86 silver badges108 bronze badges
asked Jun 8, 2017 at 4:57
Giala JeffersonGiala Jefferson
1,9298 gold badges22 silver badges30 bronze badges
3
|
1 Answer
Reset to default 20You need to change it to the code below.
return (<UserList id={subactions} key={ `applications${query.status}` } />)
key={'applications'+query.status}
work? – Jaromanda X Commented Jun 8, 2017 at 5:07key={`applications${query.status}`}
work? – user663031 Commented Jun 8, 2017 at 5:29