= P & {
/**
* If the extension doesn't actually want to render the `FormMessage`
* component, these props are optional. It kind of eliminates the whole
* purpose of this component though.
*/
messageProps?: MessageProps;
/**
* Any props (and an optional ref) to provide to the `
` surrounding the
* children and `FormMessage` component.
*
* Note: This will not be used if the `messageProps` are not provided since
* only the `children` will be returned without the container.
*/
messageContainerProps?: MessageContainerProps;
};
/**
* @remarks \@since 2.5.0
*/
export interface FormMessageContainerProps extends DivAttributes {
/**
* If the extension doesn't actually want to render the `FormMessage`
* component, these props are optional. It kind of eliminates the whole
* purpose of this component though.
*/
messageProps?: MessageProps;
}
/**
* A wrapper component that can be used to display a `TextField` related
* component or `TextArea` along with the `FormMessage` component.
*
* @remarks \@since 2.5.0
*/
export const FormMessageContainer = forwardRef<
HTMLDivElement,
FormMessageContainerProps
>(function FormMessageContainer(
{ className, children, messageProps, ...props },
ref
): ReactElement {
if (!messageProps) {
return <>{children}>;
}
return (
{children}
);
});