Files
desktop/app/providers/AccountProvider/useAccountProvider.tsx
rosetta 83f38dc63f 'init'
2026-01-30 05:01:05 +02:00

11 lines
372 B
TypeScript

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;
}