update login flow, in the middle,
This commit is contained in:
14
002_source/ionic_mobile/src/hooks/use-user.tsx
Normal file
14
002_source/ionic_mobile/src/hooks/use-user.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { UserContext } from '../contexts/auth/user-context';
|
||||
import { UserContextValue } from '../contexts/auth/types';
|
||||
|
||||
export function useUser(): UserContextValue {
|
||||
const context = React.useContext(UserContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error('useUser must be used within a UserProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
Reference in New Issue
Block a user