First, you have to use ReactDOM
to render your component to the browser not React
.
You code is:
React.render(
<secondComponenent id="abc" />,
document.getElementById('react_example')
);
But in recent versions of React
(above 0.14) it must be:
ReactDOM.render(
<secondComponenent id="abc" />,
document.getElementById('react_example')
);
To make it work you can add this library to your html.
Second, you must close your component when it hasn't child components like this: <secondComponent id="abc" />
, your writing like this: <secondComponent id="abc">
.
In order to render multiple components in react, you have to wrap them with a single parent component for example like this:
ReactDOM.render(
<div>
<firstComponenent id="abc" />
<secondComponenent id="abc" />
</div>,
document.getElementById('react_example')
);
P.S: Also, as @alexi2 says: class SomeComponent
not Class SomeComponent
.