We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8c37ea commit c5e8f7bCopy full SHA for c5e8f7b
apps/sim/components/emcn/components/toast/toast.tsx
@@ -6,6 +6,7 @@ import {
6
useCallback,
7
useContext,
8
useEffect,
9
+ useMemo,
10
useRef,
11
useState,
12
} from 'react'
@@ -197,7 +198,10 @@ export function ToastProvider({ children }: { children?: ReactNode }) {
197
198
}
199
}, [addToast])
200
- const ctx: ToastContextValue = { toast: toastFn.current, dismiss: dismissToast }
201
+ const ctx = useMemo<ToastContextValue>(
202
+ () => ({ toast: toastFn.current, dismiss: dismissToast }),
203
+ [dismissToast]
204
+ )
205
206
return (
207
<ToastContext.Provider value={ctx}>
0 commit comments