Files
the-biergarten-app/web/frontend/app/features/auth/hooks/useActionErrorToast.ts

9 lines
264 B
TypeScript

import { useEffect } from 'react';
import { showErrorToast } from '../../../components/ui/toast/toast';
export const useActionErrorToast = (error: string | undefined | null) => {
useEffect(() => {
if (error) showErrorToast(error);
}, [error]);
};