@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
11 lines (10 loc) • 342 B
JavaScript
'use client';
import { createContext, useContext } from 'react';
export const ToastContext = createContext(undefined);
export function useToastContext() {
const context = useContext(ToastContext);
if (!context) {
throw new Error('useToastContext should be used within the ToastContext provider!');
}
return context;
}