'init'
This commit is contained in:
11
app/providers/DialogStateProvider.tsx/useDialogState.ts
Normal file
11
app/providers/DialogStateProvider.tsx/useDialogState.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { DialogStateContext, DialogStateContextValue } from "./DialogStateProvider";
|
||||
|
||||
export function useDialogState() : DialogStateContextValue {
|
||||
const context = useContext(DialogStateContext);
|
||||
if(!context){
|
||||
throw new Error("useDialogState must be used within a DialogStateProvider");
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user