Skip to content Skip to sidebar Skip to footer

Pass Array Of Strings To React Component With String Coming From Json File And Allow Inline Span Tags

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 the paragraph

Solution 1:

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


Post a Comment for "Pass Array Of Strings To React Component With String Coming From Json File And Allow Inline Span Tags"