Skip to content

Commit

Permalink
se restable archivo de error de componente
Browse files Browse the repository at this point in the history
  • Loading branch information
angel1285528 committed May 20, 2024
1 parent 80125e4 commit 4a19e2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/(gestionatl)/ui/forms-fields/errorComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { FieldError, FieldErrorsImpl, Merge } from 'react-hook-form'; // Importa FieldErrorsImpl

type ErrorMessageProps = {
error?: FieldError | Merge<FieldError, FieldErrorsImpl<any>> | null;
};

const ErrorMessage: React.FC<ErrorMessageProps> = ({ error }) => {
if (!error || typeof error.message !== 'string') return null;

return <span className='text-red-500 mt-1'>{error.message}</span>;
};

export default ErrorMessage;

0 comments on commit 4a19e2a

Please sign in to comment.