Fix: Resolve Toast Type Error
The toast function was updated to correctly pass the 'id' property, resolving the TypeScript error.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import * as React from "react"
|
||||
import { ToastProps } from "@/components/ui/toast"
|
||||
|
||||
import { useToast as useToastStore } from "@/components/ui/use-toast"
|
||||
import { useToastStore } from "@/components/ui/use-toast"
|
||||
import { ToastActionElement } from "@/components/ui/toast"
|
||||
|
||||
// 기본 지속 시간 늘리기 (기존 3000ms → 3500ms)
|
||||
@@ -16,6 +16,7 @@ export type ToasterToast = ToastProps & {
|
||||
description?: React.ReactNode;
|
||||
action?: React.ReactNode;
|
||||
duration?: number; // 지속 시간 추가
|
||||
variant?: "default" | "destructive"; // variant 속성 추가
|
||||
};
|
||||
|
||||
const actionTypes = ['default', 'cancel'] as const
|
||||
@@ -69,7 +70,7 @@ export const useToast = () => {
|
||||
addToast,
|
||||
updateToast,
|
||||
dismissToast,
|
||||
toast: (props: ToasterToast) => addToast(props), // toast 속성 추가
|
||||
toast: (props: Omit<ToasterToast, "id">) => addToast(props),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user