Skip to content

Commit afefeb8

Browse files
authored
Merge pull request #17 from cobuildlab/hotfix/react-import
Hotfix/react import
2 parents 984d754 + 7bc08bf commit afefeb8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

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)