13 lines
321 B
TypeScript
13 lines
321 B
TypeScript
import { useContext } from 'react';
|
|
import { CreditAddContext } from './CreditAddContext';
|
|
|
|
const useCreditAddContext = () => {
|
|
const context = useContext(CreditAddContext);
|
|
|
|
if (!context) throw new Error('useCreditAddContext must be used within AuthProvider');
|
|
|
|
return context;
|
|
};
|
|
|
|
export { useCreditAddContext };
|