import React , { HTMLProps } from 'react' ; import { TreeItem } from './TreeItem' ; import { TreeItemIndex } from '../types' ; import { useTree } from '../tree/Tree' ; export const TreeItemChildren = ( props ) : JSX . Element => { const { renderers , treeInformation } = useTree ( ) ; const childElements = [ ] ; for ( const child of props . children ) { childElements . push ( < TreeItem key = { child } itemIndex = { child } depth = { props . depth } / > ) ; } if ( childElements . length === 0 ) { return null as any ; } const containerProps = { role : 'group' } ; return renderers . renderItemsContainer ( { children : childElements , info : treeInformation , containerProps } ) as any ; } ;