Maya
Maya

Reputation: 1

How to include span tags in an array?

I think this question has been asked before but I couldn't find a satisfactory answer. I am building a page using React and I need to make some parts of the text bold. Normally I would do this using span tags but the problem is that the text is coming from an array. I tried including the span tag in the array by concatenation but I am getting a weird result. Anyone knows a workaround?

the code the result

Upvotes: 0

Views: 207

Answers (1)

AdriSolid
AdriSolid

Reputation: 2825

Try wrapping your string in a p tag like:

<p>Bla bla bla <span>...</span></p>

Upvotes: 1

Related Questions