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