Pass array of strings to React component with string coming from json file and allow inline span tags

前端 未结 1 1145
别跟我提以往
别跟我提以往 2021-01-27 15:05

I\'m trying to get an array of strings to display as paragraphs and allow an inline span tag inside of these strings.

My issue comes is when the value is added inside th

相关标签:
1条回答
  • 2021-01-27 15:31

    By default, React escapes HTML to prevent XSS just use dangerouslySetInnerHTML, take a look at oficial docs

    0 讨论(0)
提交回复
热议问题