Skip to content

Commit 8cf5b54

Browse files
committed
fix import react
1 parent 984d754 commit 8cf5b54

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/context.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createContext, useContext } from 'react';
1+
import * as React from 'react';
22
import { 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

1818
export const useAuth = (): AuthClientContextType =>
19-
useContext(AuthClientContext);
19+
React.useContext(AuthClientContext);

src/hook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { useContext } from 'react';
1+
import * as React from 'react';
22

33
import { AuthClientContext } from './context';
44
import { AuthClientContextType } from './types';
55

66
export const useAuth = (): AuthClientContextType =>
7-
useContext(AuthClientContext);
7+
React.useContext(AuthClientContext);

src/provider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from 'react';
1+
import * as React from 'react';
22
import { Auth0Native } from './client';
33
import { AuthClientContext } from './context';
44
import { 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,

0 commit comments

Comments
 (0)