Here, i have two components. One is ComponentOne and another one ComponentTwo. Currently i'm rendering only one component that is ComponentTwo.
var ComponentOne = React.createClass({
render: function() {
<div className="card">
<h2>Component one</h2>
</div>
}
});
var ComponentTwo = React.createClass({
render: function() {
<div className="card">
<h2>Component two</h2>
<button>Insert</button>
</div>
<ComponentOne />
}
});
If i click Insert button ComponentOne will insert after componenttwo class element card. How to achieve this one with reactjs?