React - How to pass HTML tags in props?

前端 未结 20 1339
甜味超标
甜味超标 2020-12-07 11:58

I want to be able to pass text with HTML tags, like so:

not working.\" />

Bu

20条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 12:46

    Parser from html-react-parser is a good solution. You just have to

    • install it with npm or yarn
    • import Parser from 'html-react-parser';
    • call it with :

      not working.") />
      

      and it works well.

提交回复
热议问题