# Interface ReactChildren

#### Deprecated

- Use `typeof React.Children` instead.

interface ReactChildren {
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)[];
}

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4187

#####
Index

### Methods

count
forEach
map
only
toArray

## Methods

### count

- count(children): number

- #### Parameters

  - children: any

  #### Returns number

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4193

### forEach

- forEach<C>(children, fn): void

- #### Type Parameters

  - C

  #### Parameters

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

      - #### Parameters

        - child: C
        - index: number

        #### Returns void

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4192

### map

- map<T, C>(children, fn): C extends null
  ? C<C>
  : Exclude<T, boolean>[]

- #### 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>[]

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4188

### only

- only<C>(children): C extends any[]
  ? never
  : C

- #### Type Parameters

  - C

  #### Parameters

  - children: C

  #### Returns C extends any[]
  ? never
  : C

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4194

### toArray

- toArray(children): (string | number | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal)[]

- #### Parameters

  - children: ReactNode | ReactNode[]

  #### Returns (string | number | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal)[]

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:4195