import React, { forwardRef } from 'react'; import { useFormControlProvider, FormControlContext } from './useFormControl'; import type { IFormControlProps } from './types'; const FormControl = (StyledFormControlBox: React.ComponentType) => forwardRef(({ ...props }: T & IFormControlProps, ref?: any) => { const { htmlProps, ...context } = useFormControlProvider(props); const { isDisabled, isInvalid, ...remainingProps } = context; return ( ); }); export default FormControl;