TanStackT
TanStack9mo ago
9 replies
comprehensive-tomato

Double toasts on error

so when the getAcedmic years throw an error am getting two taosts same message, even after disabling retries
const { isPending, isError, data, error } = useQuery({
  queryKey: ["academic-years"],
  queryFn: getAcademicYears,
});

if (isError) {
  toast.error(error.message);
}

const table = useReactTable({
  columns,
  data: data ?? [],
  getCoreRowModel: getCoreRowModel(),
});
Was this page helpful?