10 lines
220 B
TypeScript
10 lines
220 B
TypeScript
import { useEffect } from "react";
|
|
import { toastError } from "../lib/toast";
|
|
|
|
export function useToastOnError(error?: string | null) {
|
|
useEffect(() => {
|
|
if (!error) return;
|
|
toastError(error);
|
|
}, [error]);
|
|
}
|