import React, { Children } from 'react'; import { ReferenceArrayInput as RaReferenceArrayInput, ReferenceArrayInputProps as RaReferenceArrayInputProps } from 'react-admin'; type ReferenceArrayInputProps = RaReferenceArrayInputProps; function ReferenceArrayInput({ children, ...props }: ReferenceArrayInputProps): JSX.Element { const Child = Children.only(children); return ( {React.cloneElement(Child!, { ...props, source: Child!.props.source || props.source })} ); } export { ReferenceArrayInput }; export type { ReferenceArrayInputProps };