I use setState to update the html part, but I found that the new html update is not showing. 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 updates html from the server, but the result is the same. How to enable display of string in state?
source share