Skip to content

Commit

Permalink
merge branch tmp/reactv19changes to feature/react19
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharpandey13 committed Jan 15, 2025
2 parents 1923a5f + 5715ede commit 038f24d
Show file tree
Hide file tree
Showing 9 changed files with 4,034 additions and 2,961 deletions.
2 changes: 1 addition & 1 deletion __tests__/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const createWrapper = ({
}: Partial<Auth0ProviderOptions> = {}) => {
return function Wrapper({
children,
}: PropsWithChildren<Record<string, unknown>>) {
}: PropsWithChildren<Record<string, unknown>>): React.JSX.Element {
return (
<Auth0Provider domain={domain} clientId={clientId} {...opts}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/ssr.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('In a Node SSR environment', () => {
ReactDOMServer.renderToString(
<Auth0Provider clientId="__client_id__" domain="__domain__">
<Auth0Context.Consumer>
{(value) => {
{(value): React.JSX.Element => {
({ isLoading, isAuthenticated, user, loginWithRedirect } = value);
return <div>App</div>;
}}
Expand Down
10 changes: 5 additions & 5 deletions examples/cra-react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@auth0/auth0-react": "file:../..",
"@auth0/auth0-react": "2.2.4",
"@types/node": "^17.0.29",
"@types/react": "file:../../node_modules/@types/react",
"@types/react-dom": "file:../../node_modules/@types/react-dom",
"react": "file:../../node_modules/react",
"react-dom": "file:../../node_modules/react-dom",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"typescript": "^4.6.3"
Expand Down
15 changes: 8 additions & 7 deletions examples/cra-react-router/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createRoot } from "react-dom/client";
import React, { PropsWithChildren } from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import App from './App.js';
import { Auth0Provider, AppState } from '@auth0/auth0-react';
import { BrowserRouter, useNavigate } from 'react-router-dom';
import { Auth0ProviderOptions } from '../../../src';
import { Auth0ProviderOptions } from '../../../src/index.js';

const Auth0ProviderWithRedirectCallback = ({
children,
Expand All @@ -12,7 +12,7 @@ const Auth0ProviderWithRedirectCallback = ({
const navigate = useNavigate();

const onRedirectCallback = (appState?: AppState) => {
navigate((appState && appState.returnTo) || window.location.pathname);
navigate((appState?.returnTo) || window.location.pathname);
};

return (
Expand All @@ -22,7 +22,9 @@ const Auth0ProviderWithRedirectCallback = ({
);
};

ReactDOM.render(
const root = createRoot(document.getElementById('root')!);

root.render(
<React.StrictMode>
<BrowserRouter>
<Auth0ProviderWithRedirectCallback
Expand All @@ -37,6 +39,5 @@ ReactDOM.render(
<App />
</Auth0ProviderWithRedirectCallback>
</BrowserRouter>
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
Loading

0 comments on commit 038f24d

Please sign in to comment.