File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @cobuildlab/react-native-auth0" ,
3
- "version" : " 0.3.2 " ,
3
+ "version" : " 0.3.3 " ,
4
4
"description" : " Todo" ,
5
5
"main" : " lib/index.js" ,
6
6
"types" : " ./lib/index.d.ts" ,
Original file line number Diff line number Diff line change 1
- import { createContext , useContext } from 'react' ;
1
+ import * as React from 'react' ;
2
2
import { AuthClientContextType } from './types' ;
3
3
4
4
/**
@@ -8,12 +8,12 @@ const stub = (): never => {
8
8
throw new Error ( 'You forgot to wrap your component in <Auth0Provider>.' ) ;
9
9
} ;
10
10
11
- export const AuthClientContext = createContext < AuthClientContextType > ( {
11
+ export const AuthClientContext = React . createContext < AuthClientContextType > ( {
12
12
isAuthenticated : false ,
13
13
isLoading : true ,
14
14
clearSession : stub ,
15
15
authorize : stub ,
16
16
} ) ;
17
17
18
18
export const useAuth = ( ) : AuthClientContextType =>
19
- useContext ( AuthClientContext ) ;
19
+ React . useContext ( AuthClientContext ) ;
Original file line number Diff line number Diff line change 1
- import { useContext } from 'react' ;
1
+ import * as React from 'react' ;
2
2
3
3
import { AuthClientContext } from './context' ;
4
4
import { AuthClientContextType } from './types' ;
5
5
6
6
export const useAuth = ( ) : AuthClientContextType =>
7
- useContext ( AuthClientContext ) ;
7
+ React . useContext ( AuthClientContext ) ;
Original file line number Diff line number Diff line change 1
- import React , { useEffect , useState } from 'react' ;
1
+ import * as React from 'react' ;
2
2
import { Auth0Native } from './client' ;
3
3
import { AuthClientContext } from './context' ;
4
4
import { AuthClientContextType } from './types' ;
@@ -7,15 +7,15 @@ export const AuthProvider: React.FC<{
7
7
client : Auth0Native ;
8
8
scope : string ;
9
9
} > = ( { children, client, scope } ) => {
10
- const [ state , setState ] = useState < {
10
+ const [ state , setState ] = React . useState < {
11
11
isLoading : boolean ;
12
12
isAuthenticated : boolean ;
13
13
} > ( {
14
14
isAuthenticated : false ,
15
15
isLoading : true ,
16
16
} ) ;
17
17
18
- useEffect ( ( ) => {
18
+ React . useEffect ( ( ) => {
19
19
client . isAuthenticated ( ) . then ( ( isAuth ) => {
20
20
setState ( ( prev ) => ( {
21
21
...prev ,
You can’t perform that action at this time.
0 commit comments