UNPKG

@brightlayer-ui/react-native-auth-workflow

Version:

Re-usable workflow components for Authentication and Registration within Eaton applications.

20 lines (19 loc) 564 B
import { useContext } from 'react'; import { ErrorContext } from './context'; import { ErrorContextProvider } from './provider'; import { useErrorManager } from './useErrorManager'; /** * Hook to get top level error data * * @category Hooks * @private * @internal */ export const useErrorContext = () => { const context = useContext(ErrorContext); if (context === null) { throw new Error('useErrorContext must be used within ErrorContextProvider'); } return context; }; export { ErrorContext, ErrorContextProvider, useErrorManager };