I use setState to update part of the html but I found the new update html is not rendered. Here is the code, js fiddle:
html:
<div>hello<br />world<br /></div>
<div id='content'></div>
js:
var Main = React.createClass({
getInitialState: function() {
return {output: 'hello<br />world<br />'};
},
render: function() {
return (
<div>
{this.state.output}
</div>
);
}
});
React.renderComponent(<Main/>, document.getElementById('content'));
I omit the part that update html from the server but the result is the same. How to let the string in state be rendered?