14 lines
351 B
TypeScript
14 lines
351 B
TypeScript
import { useContext } from 'react';
|
|
import { ManageSucosContext } from './ManageSucosContext';
|
|
|
|
const useManageSucosContext = () => {
|
|
const context = useContext(ManageSucosContext);
|
|
|
|
if (!context)
|
|
throw new Error('useManageSucosContext must be used within ManageSucosContextProvider');
|
|
|
|
return context;
|
|
};
|
|
|
|
export { useManageSucosContext };
|