Learn React - Day 02
DAY 02 005 Returning Mulitple Elements If you want to return multiple elements from your costume class, you need to wrap them in a div return ( React.createElement('div', null, h1, p) ); Example (005 Returning Multiple Elements) var h1 = React.createElement('h1', null, 'First Component'); var p = React.createElement('p', null, 'A quick brown fox jumps over the lazy dog.'); class CustomeComponent extends React.Component { render(){ return ( React.createElement('div', null, h1, p) ); } } var firstComponent = React.createElement(CustomeComponent, null); var content = document.getElementById("content"); ReactDOM.render(firstComponent, content); See the Pen 005 Returning Multiple Elements by Mustafa Khan ( @MKs-Notebook ) on CodePen .