Юниверс DG SDK UI
v2.15.0

Интерфейс ReactChildren

interface ReactChildren {
    count(children: any): number;
    forEach<C>(children: C | C[], fn: (child: C, index: number) => void): void;
    map<T, C>(
        children: C | C[],
        fn: (child: C, index: number) => T,
    ): C extends null
    | undefined
        ? C<C>
        : Exclude<T, boolean | null | undefined>[];
    only<C>(children: C): C extends any[] ? never : C;
    toArray(
        children: ReactNode | ReactNode[],
    ): (ReactChild | ReactFragment | ReactPortal)[];
}
Индекс

Методы

  • Параметры

    • children: any

    Возвращает number

  • Параметры типа

    • C

    Параметры

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

    Возвращает void

  • Параметры типа

    • T
    • C

    Параметры

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

    Возвращает C extends null | undefined ? C<C> : Exclude<T, boolean | null | undefined>[]

  • Параметры типа

    • C

    Параметры

    • children: C

    Возвращает C extends any[] ? never : C