React - How to pass HTML tags in props?

前端 未结 20 1300
甜味超标
甜味超标 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:42

    @matagus answer is fine for me, Hope below snippet is helped those who wish to use a variable inside.

    const myVar = 'not';
    {`${myVar}`},  "working."]} />
    

提交回复
热议问题