那么这是用reactjs渲染原始html的唯一方法吗?
// http://facebook.github.io/react/docs/tutorial.html
// tutorial7.js
var converter = new Showdown.converter();
var Comment = React.createClass({
render: function() {
var rawMarkup = converter.makeHtml(this.props.children.toString());
return (
{this.props.author}
);
}
});
我知道有一些很酷的方法来用JSX标记内容,但是我主要感兴趣的是能够呈现原始html(包括所有类,内联样式等)。像这样复杂的事情:
Dropdown
我不想在JSX中重写所有内容。
也许我在想这一切错。请纠正我。