Reputation: 855
I am currently mapping over data, and I want to concatenate 2 variables together.
For example:
<img src={image path}{image name from .map} />
So the question is, how do i combine these both into one?
Upvotes: 0
Views: 937
Reputation: 56
use back tack for example
<img src={`${image path}${image name from .map}`} />
Upvotes: 1
Reputation: 1459
there are a lot of ways to do it, one could be with string literals interpolation:
<img src={`${variable1}${variable2}`}/>
Upvotes: 4