I'm gradually replacing some Backbone views with React.
My React View:
<div id="reactViewContent">Rendered By React</div>
I need to render the React view below other html elements without replacing them.
<div id="somestuff">
<div id="anotherView">Other stuff not to delete</div>
<div id="placeholderForReactView"></div>
</div>
I'd like that my method could replace the placeholder instead of inserting into it so that :
React.render(React.createElement(MyTestReactView), document.getElementById('placeholderForReactView'));
could result in:
<div id="somestuff">
<div>Other stuff not to delete</div>
<div id="reactViewContent">Rendered By React</div>
</div>
instead of:
<div id="somestuff">
<div>Other stuff not to delete</div>
<div id="placeholderForReactView">
<div id="reactViewContent">Rendered By React</div>
</div>
</div>
Without recurring at Jquery is there a correct way to do it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…