diff --git a/client/src/Providers/ToastContext.tsx b/client/src/Providers/ToastContext.tsx index 88229f9c0..10ae884da 100644 --- a/client/src/Providers/ToastContext.tsx +++ b/client/src/Providers/ToastContext.tsx @@ -1,4 +1,4 @@ -import { createContext } from 'react'; +import { createContext, useContext } from 'react'; import type { TShowToast } from '~/common'; import { useToast } from '~/hooks'; @@ -10,6 +10,10 @@ export const ToastContext = createContext({ showToast: () => ({}), }); +export function useToastContext() { + return useContext(ToastContext); +} + export default function ToastProvider({ children }) { const { showToast } = useToast();