import React, { forwardRef, HTMLAttributes, ReactElement } from 'react'; import { useVirtualGridRepeaterContext } from './VirtualGridRepeaterContext'; import { VirtualGridItem } from './VirtualGridItem'; import { ForceRenderIndexesObserver } from './ForceRenderIndexes'; export const GridForceRenderIndexes = forwardRef< HTMLDivElement, { children: ReactElement[] } & HTMLAttributes >(({ children, ...props }, ref) => { const { state } = useVirtualGridRepeaterContext(); return ( ( { if (typeof ref === 'function') { ref(el); } else if (ref) { ref.current = el; } state.innerElement = el; }} {...listAttributes} {...props} > {contents} )} > {children} ); });