mt-flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
10 lines (9 loc) • 328 B
JavaScript
import { createContext, useContext } from 'react';
export const ModalContext = createContext(undefined);
export function useModalContext() {
const context = useContext(ModalContext);
if (!context) {
throw new Error('useModalContext should be used within the ModalContext provider!');
}
return context;
}