How to render more than on component in single id,i know that single id can not render more than one component, i also tried getElementByClass
but the result was same
function Ads(product) {
return(
<div className={product.className} id="user-ads">
<div className = "col-sm-6 col-md-5">
<div className = "thumbnail">
<img src={product.image} alt="product-image"/>
</div>
<div className = "caption">
<div className="border">
<h3>{product.title}</h3>
<p>{product.desc}</p>
<button className = "btn btn-primary" role = "button" data-toggle="modal" data-target="#view-detail">View Details
</button>
</div>
</div>
</div>
</div>
);
}
function Newad(product) {
return (
<Ads title="Forza" desc="rndom text rndom text rndom text rndom text" image="img/img2.jpg" />
);
}
ReactDOM.render(<Ads title="PlayStation 4" desc="Lorem ipsum jipsum Lorem ipsum jipsum" image="img/img1.jpg" className="row" />, document.getElementById('all_ads'));
ReactDOM.render(<Newad />, document.getElementById('all_ads'));