mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-27 15:14:30 +00:00
13 lines
295 B
JavaScript
13 lines
295 B
JavaScript
'use strict';
|
|
|
|
var React = require('react');
|
|
|
|
function isValidChild(object) {
|
|
return object == null || React.isValidElement(object);
|
|
}
|
|
|
|
function isReactChildren(object) {
|
|
return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
|
|
}
|
|
|
|
module.exports = isReactChildren; |