var MyBox = React.createClass({
rawMarkup: function() {
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
return { __html: rawMarkup };
},
getElements: function () {
//I want to be able to return raw HTML string
//from here to inject into another element via jQuery
},
loadCommentsFromServer: function() {
},
getInitialState: function() {
return {data: []};
},
componentDidMount: function() {
this.loadCommentsFromServer();
window.drill = this;
},
render: function() {
return (
<ul>
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
);
}
});
via Javascript using jQuery I want to inject the output to another element like below
$(clicked).html(window.drill.getElements());
window.thisis the react component, not the actual HTML. Give your component anid, then you can simply read it from the DOM using jQuery.