Variable ChildrenConst

Children: {
    count(children): number;
    forEach<C>(children, fn): void;
    map<T, C>(children, fn): C extends null
        ? C<C>
        : Exclude<T, boolean>[];
    only<C>(children): C extends any[]
        ? never
        : C;
    toArray(children): (string | number | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal)[];
}

Maintainer's note: Sync with ReactChildren until ReactChildren is removed.

Type declaration

  • count:function
    • Parameters

      • children: any

      Returns number

  • forEach:function
    • Type Parameters

      • C

      Parameters

      • children: C | readonly C[]
      • fn: ((child, index) => void)
          • (child, index): void
          • Parameters

            • child: C
            • index: number

            Returns void

      Returns void

  • map:function
    • Type Parameters

      • T
      • C

      Parameters

      • children: C | readonly C[]
      • fn: ((child, index) => T)
          • (child, index): T
          • Parameters

            • child: C
            • index: number

            Returns T

      Returns C extends null
          ? C<C>
          : Exclude<T, boolean>[]

  • only:function
    • Type Parameters

      • C

      Parameters

      • children: C

      Returns C extends any[]
          ? never
          : C

  • toArray:function