fix: support default and named exports for useDebounce hook
Ensure compatibility with both default and named exports for useDebounce. Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect } from "react"
|
||||
import {
|
||||
Toast,
|
||||
ToastAction,
|
||||
@@ -15,14 +14,6 @@ import { useToast } from "@/components/ui/use-toast"
|
||||
export function Toaster() {
|
||||
const { toasts } = useToast()
|
||||
|
||||
// 可选:在开发环境输出调试信息
|
||||
useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug("[Toaster] toasts", toasts)
|
||||
}
|
||||
}, [toasts])
|
||||
|
||||
return (
|
||||
<ToastProvider>
|
||||
{toasts.map(function ({ id, title, description, action, ...props }) {
|
||||
@@ -42,4 +33,5 @@ export function Toaster() {
|
||||
)
|
||||
}
|
||||
|
||||
export default Toaster
|
||||
export { ToastAction }
|
||||
|
||||
Reference in New Issue
Block a user