text: function traverseChildren(children, result) {
    if (Array.isArray(children)) {
      for (let i = 0, l = children.length; i < l; i++) {
        traverseChildren(children[i], result);
      }
    } else {
      result.push(children);
    }
  }
  
  export default function flattenChildren(children) {
    if (children == null) {
      return children;
    }
    let result = [];
    traverseChildren(children, result);
  
    if (result.length === 1) {
      result = result[0];
    }
  
    return result;
  }