class RootContent extends React.Component{
constructor(props){
super(props);
}
render(){
return (
<div className='divider'>
{this.props.children}
</div>
);
}
}
class RootChild extends React.Component{
constructor(props){
super(props);
}
render(){
return (
<RootContent>
<p>Hello, React</p>
<p>Hello, Redux</p>
<p>Hello, Facebook</p>
<p>Hello, Google</p>
</RootContent>
);
}
}
ReactDOM.render(
<RootChild />,
document.querySelector('#root')
);
网友评论