import React, { JSX } from 'react'; import { RenderProps } from '../isRenderProps'; import { State } from './State'; export interface Props { states?: T[]; children: JSX.Element | RenderProps; } export const States = ({ states = [{} as T], children, ...rest }: Props) => { return ( <> {states.map((props, index) => ( key={index} props={props} {...rest}> {children} ))} ); };