UNPKG

@brightlayer-ui/react-auth-workflow

Version:

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

21 lines (20 loc) 545 B
/** * @packageDocumentation * @module RegistrationContext */ import { createContext, useContext } from 'react'; export const RegistrationContext = createContext(null); /** * Hook to get the data of each registration workflow screen * * @category Hooks * @private * @internal */ export const useRegistrationContext = () => { const context = useContext(RegistrationContext); if (context === null) { throw new Error('useRegistrationContext must be used within an RegistrationContextProvider'); } return context; };