Skip to content

Commit 038f24d

Browse files
merge branch tmp/reactv19changes to feature/react19
2 parents 1923a5f + 5715ede commit 038f24d

File tree

9 files changed

+4034
-2961
lines changed

9 files changed

+4034
-2961
lines changed

__tests__/helpers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const createWrapper = ({
88
}: Partial<Auth0ProviderOptions> = {}) => {
99
return function Wrapper({
1010
children,
11-
}: PropsWithChildren<Record<string, unknown>>) {
11+
}: PropsWithChildren<Record<string, unknown>>): React.JSX.Element {
1212
return (
1313
<Auth0Provider domain={domain} clientId={clientId} {...opts}>
1414
{children}

__tests__/ssr.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('In a Node SSR environment', () => {
1313
ReactDOMServer.renderToString(
1414
<Auth0Provider clientId="__client_id__" domain="__domain__">
1515
<Auth0Context.Consumer>
16-
{(value) => {
16+
{(value): React.JSX.Element => {
1717
({ isLoading, isAuthenticated, user, loginWithRedirect } = value);
1818
return <div>App</div>;
1919
}}

examples/cra-react-router/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@auth0/auth0-react": "file:../..",
6+
"@auth0/auth0-react": "2.2.4",
77
"@types/node": "^17.0.29",
8-
"@types/react": "file:../../node_modules/@types/react",
9-
"@types/react-dom": "file:../../node_modules/@types/react-dom",
10-
"react": "file:../../node_modules/react",
11-
"react-dom": "file:../../node_modules/react-dom",
8+
"@types/react": "18.3.18",
9+
"@types/react-dom": "18.3.5",
10+
"react": "18.3.1",
11+
"react-dom": "18.3.1",
1212
"react-router-dom": "^6.3.0",
1313
"react-scripts": "^5.0.1",
1414
"typescript": "^4.6.3"

examples/cra-react-router/src/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { createRoot } from "react-dom/client";
12
import React, { PropsWithChildren } from 'react';
2-
import ReactDOM from 'react-dom';
3-
import App from './App';
3+
import App from './App.js';
44
import { Auth0Provider, AppState } from '@auth0/auth0-react';
55
import { BrowserRouter, useNavigate } from 'react-router-dom';
6-
import { Auth0ProviderOptions } from '../../../src';
6+
import { Auth0ProviderOptions } from '../../../src/index.js';
77

88
const Auth0ProviderWithRedirectCallback = ({
99
children,
@@ -12,7 +12,7 @@ const Auth0ProviderWithRedirectCallback = ({
1212
const navigate = useNavigate();
1313

1414
const onRedirectCallback = (appState?: AppState) => {
15-
navigate((appState && appState.returnTo) || window.location.pathname);
15+
navigate((appState?.returnTo) || window.location.pathname);
1616
};
1717

1818
return (
@@ -22,7 +22,9 @@ const Auth0ProviderWithRedirectCallback = ({
2222
);
2323
};
2424

25-
ReactDOM.render(
25+
const root = createRoot(document.getElementById('root')!);
26+
27+
root.render(
2628
<React.StrictMode>
2729
<BrowserRouter>
2830
<Auth0ProviderWithRedirectCallback
@@ -37,6 +39,5 @@ ReactDOM.render(
3739
<App />
3840
</Auth0ProviderWithRedirectCallback>
3941
</BrowserRouter>
40-
</React.StrictMode>,
41-
document.getElementById('root')
42+
</React.StrictMode>
4243
);

0 commit comments

Comments
 (0)