I am building something with React where I need to insert HTML with React Variables in JSX.(我正在用React构建一些东西,我需要在JSX中插入带有React变量的HTML。)
Is there a way to have a variable like so:(有没有办法像这样一个变量:)
var thisIsMyCopy = '<p>copy copy copy <strong>strong copy</strong></p>';
and to insert it into react like so, and have it work?(并像这样将其插入反应中并起作用?)
render: function() {
return (
<div className="content">{thisIsMyCopy}</div>
);
}
and have it insert the HTML as expected?(并按预期插入HTML吗?) I haven't seen or heard anything about a react function that could do this inline, or a method of parsing things that would allow this to work.(我还没有看到或听到任何有关可以完成此内联的react函数的信息,也没有听说过任何使之能够工作的解析方法。)
ask by Kyle Hotchkiss translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…