13 lines
295 B
JavaScript
Raw Normal View History

2015-04-29 11:02:32 +02:00
'use strict';
2015-04-21 19:38:17 +02:00
2015-04-29 11:02:32 +02:00
var React = require('react');
2015-04-21 19:38:17 +02:00
function isValidChild(object) {
return object == null || React.isValidElement(object);
}
function isReactChildren(object) {
return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
}
module.exports = isReactChildren;