render() {
let component = true ? <Comp1 /> : <Comp2 />;
return (
<div>{component}</div>
);
}
var FluxCart = React.createClass({...})
var App = React.createClass({
render : function () {
var component = this.state.conditionToRenderCart ? <FluxCart /> : null;
return (
<div>
{component}
</div>
)
}
})
React.render(<MyComponent />, document.getElementById('container'));
React.unmountComponentAtNode(document.getElementById('container'));