Lilact
    Preparing search index...

    Variable ChildrenConst

    Children: {
        _flattenInto(out: any[], input: any): void;
        _isNil(x: any): boolean;
        count(children: Iterable<any, any, any>): number;
        find(
            children: Iterable<any, any, any>,
            predicate: (child: any, index: number) => boolean,
        ): any;
        first(children: Iterable<any, any, any>): any;
        forEach(
            children: Iterable<any, any, any>,
            fn: (child: any, index: number) => void,
        ): void;
        last(children: Iterable<any, any, any>): any;
        map(
            children: Iterable<any, any, any>,
            fn: (child: any, index: number) => any,
        ): any[];
        only(children: Iterable<any, any, any>): any;
        pickOne(
            children: Iterable<any, any, any>,
            predicate: (child: any, index: number) => boolean,
        ): any;
        toArray(children: Iterable<any, any, any>): any[];
    } = ...

    Children namespace for utilities that operate on props.children.

    • Flattens nested arrays recursively.
    • Omits null and undefined items (common React-like behavior).

    Type Declaration

    • _flattenInto: function
      • Recursively flattens nested arrays into out, omitting null/undefined.

        Parameters

        • out: any[]
        • input: any

        Returns void

    • _isNil: function
      • Parameters

        • x: any

        Returns boolean

    • count: function
      • Returns the number of non-null/undefined children (after flattening).

        Parameters

        • children: Iterable<any, any, any>

        Returns number

    • find: function
      • Finds the first child for which predicate returns true.

        Parameters

        • children: Iterable<any, any, any>
        • predicate: (child: any, index: number) => boolean

        Returns any

    • first: function
      • Returns the first non-nil child (after flattening), or undefined.

        Parameters

        • children: Iterable<any, any, any>

        Returns any

    • forEach: function
      • Iterates over children (after flattening & omitting nil).

        Parameters

        • children: Iterable<any, any, any>
        • fn: (child: any, index: number) => void

        Returns void

    • last: function
      • Returns the last non-nil child (after flattening), or undefined.

        Parameters

        • children: Iterable<any, any, any>

        Returns any

    • map: function
      • Maps over children (after flattening & omitting nil).

        Parameters

        • children: Iterable<any, any, any>
        • fn: (child: any, index: number) => any

        Returns any[]

    • only: function
      • Returns the single child from a children collection (after flattening & omitting nil), or throws if the remaining count is not exactly 1.

        Parameters

        • children: Iterable<any, any, any>

        Returns any

    • pickOne: function
      • Finds exactly one matching child. Throws if matched count is not exactly 1.

        Parameters

        • children: Iterable<any, any, any>
        • predicate: (child: any, index: number) => boolean

        Returns any

    • toArray: function
      • Converts an iterable children collection into a flat array, omitting null/undefined.

        Parameters

        • children: Iterable<any, any, any>

        Returns any[]