/**
 * React-related utilities
 */

import React from 'react';

/**
 * Like React.Children.forEach(), but traverses through all descendant children.
 *
 * @param children Children of a React element, i.e. `elem.props.children`
 * @param callback {function} A function to be run for each child; parameters passed: (child, indexOfChildInImmediateParent)
 */
export function reactChildrenForEachDeep(children, callback) {
  React.Children.forEach(children, (child, i) => {
    callback(child, i);
    if (child.props.children) {
      reactChildrenForEachDeep(child.props.children, callback);
    }
  });
}

@@ -241,23 +241,30 @@
 lback %7Bf
-unction
+orEachCallback
 %7D A func
@@ -296,67 +296,8 @@
 hild
-; parameters passed: (child, indexOfChildInImmediateParent)
 %0A */
@@ -543,10 +543,336 @@
 %7D%0A  %7D);%0A
-
 %7D%0A
+%0A/**%0A * This callback is displayed as part of the Requester class.%0A *%0A * @callback forEachCallback%0A * @param %7B*%7D child The React child%0A * @param %7Bnumber%7D index The index of the child in its immediate parent%0A * @param %7Bnumber%7D depth The number of parents traversed to react this child (top-level children have depth === 1)%0A */%0A

Add inline documentation for reactChildrenForEachDeep