Update Fix
This commit is contained in:
9
resources/js/admin/tailadmin/hooks/useToastOnError.ts
Normal file
9
resources/js/admin/tailadmin/hooks/useToastOnError.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useEffect } from "react";
|
||||
import { toastError } from "../lib/toast";
|
||||
|
||||
export function useToastOnError(error?: string | null) {
|
||||
useEffect(() => {
|
||||
if (!error) return;
|
||||
toastError(error);
|
||||
}, [error]);
|
||||
}
|
||||
Reference in New Issue
Block a user