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 11{
22 "name" : " @cobuildlab/react-native-auth0" ,
3- "version" : " 0.3.2 " ,
3+ "version" : " 0.3.3 " ,
44 "description" : " Todo" ,
55 "main" : " lib/index.js" ,
66 "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' ;
22import { AuthClientContextType } from './types' ;
33
44/**
@@ -8,12 +8,12 @@ const stub = (): never => {
88 throw new Error ( 'You forgot to wrap your component in <Auth0Provider>.' ) ;
99} ;
1010
11- export const AuthClientContext = createContext < AuthClientContextType > ( {
11+ export const AuthClientContext = React . createContext < AuthClientContextType > ( {
1212 isAuthenticated : false ,
1313 isLoading : true ,
1414 clearSession : stub ,
1515 authorize : stub ,
1616} ) ;
1717
1818export 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' ;
22
33import { AuthClientContext } from './context' ;
44import { AuthClientContextType } from './types' ;
55
66export 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' ;
22import { Auth0Native } from './client' ;
33import { AuthClientContext } from './context' ;
44import { AuthClientContextType } from './types' ;
@@ -7,15 +7,15 @@ export const AuthProvider: React.FC<{
77 client : Auth0Native ;
88 scope : string ;
99} > = ( { children, client, scope } ) => {
10- const [ state , setState ] = useState < {
10+ const [ state , setState ] = React . useState < {
1111 isLoading : boolean ;
1212 isAuthenticated : boolean ;
1313 } > ( {
1414 isAuthenticated : false ,
1515 isLoading : true ,
1616 } ) ;
1717
18- useEffect ( ( ) => {
18+ React . useEffect ( ( ) => {
1919 client . isAuthenticated ( ) . then ( ( isAuth ) => {
2020 setState ( ( prev ) => ( {
2121 ...prev ,
You can’t perform that action at this time.
0 commit comments