Try a custom propTypes :
const childrenPropTypeLogic = (props, propName, componentName) => {
const prop = props[propName];
return React.Children
.toArray(prop)
.find(child => child.type !== 'div') && new Error(`${componentName} only accepts "div" elements`);
};
static propTypes = {
children : childrenPropTypeLogic
}
const {Component, PropTypes} = React;_x000D_
_x000D_
const childrenPropTypeLogic = (props, propName, componentName) => {_x000D_
var error;_x000D_
var prop = props[propName];_x000D_
_x000D_
React.Children.forEach(prop, function (child) {_x000D_
if (child.type !== 'div') {_x000D_
error = new Error(_x000D_
'`' + componentName + '` only accepts children of type `div`.'_x000D_
);_x000D_
}_x000D_
});_x000D_
_x000D_
return error;_x000D_
};_x000D_
_x000D_
_x000D_
_x000D_
class ContainerComponent extends Component {_x000D_
static propTypes = {_x000D_
children: childrenPropTypeLogic,_x000D_
}_x000D_
_x000D_
render() {_x000D_
return (_x000D_
<div>_x000D_
{this.props.children}_x000D_
</div>_x000D_
);_x000D_
}_x000D_
}_x000D_
_x000D_
_x000D_
_x000D_
class App extends Component {_x000D_
render(){_x000D_
return (_x000D_
<ContainerComponent>_x000D_
<div>1</div>_x000D_
<div>2</div>_x000D_
</ContainerComponent>_x000D_
)_x000D_
}_x000D_
}_x000D_
_x000D_
ReactDOM.render(<App /> , document.querySelector('section'))
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>_x000D_
_x000D_
<section />
_x000D_