export const DownloadTrigger = ({
onError,
} {
onError: ReactQueryOptions['batch']['triggerDownload']['onError']; // This doesn't quire work is there more generic type or I should just add Error | undefined?
}) => {
const downloadMutation = api.batch.triggerDownload.useMutation({
onError,
});
useEffect(() => {
handleFile()
.catch((err: Error) => {
// @ts-ignore
onError(err);
})
.finally(() => {
// @ts-ignore
onError(undefined);
});
export const DownloadTrigger = ({
onError,
} {
onError: ReactQueryOptions['batch']['triggerDownload']['onError']; // This doesn't quire work is there more generic type or I should just add Error | undefined?
}) => {
const downloadMutation = api.batch.triggerDownload.useMutation({
onError,
});
useEffect(() => {
handleFile()
.catch((err: Error) => {
// @ts-ignore
onError(err);
})
.finally(() => {
// @ts-ignore
onError(undefined);
});