import React from 'react'; export interface FieldErrorProps extends React.ComponentPropsWithoutRef<'span'> { /** * The name of the field the ``'s associated with. */ name: string; } /** * Renders a `` with an error message if there's a validation error on the corresponding field. * If no error message is provided, a default one is used based on the type of validation that caused the error. * * @example Displaying a validation error message with `` * * `` doesn't render (i.e. returns `null`) when there's no error on ``. * * ```jsx * * * * ``` * * @see {@link https://cedarjs.com/docs/tutorial/chapter3/forms#fielderror} * * @privateRemarks * * This is basically a helper for a common pattern you see in `react-hook-form`: * * ```jsx *
* * {errors.firstName?.type === 'required' && "First name is required"} * ``` * * @see {@link https://react-hook-form.com/get-started#Handleerrors} */ export declare const FieldError: ({ name, ...rest }: FieldErrorProps) => React.JSX.Element | null; //# sourceMappingURL=FieldError.d.ts.map