File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
examples/cra-react-router/src Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1+ import { createRoot } from "react-dom/client" ;
12import React , { PropsWithChildren } from 'react' ;
2- import ReactDOM from 'react-dom' ;
3- import App from './App' ;
3+ import App from './App.js' ;
44import { Auth0Provider , AppState } from '@auth0/auth0-react' ;
55import { BrowserRouter , useNavigate } from 'react-router-dom' ;
6- import { Auth0ProviderOptions } from '../../../src' ;
6+ import { Auth0ProviderOptions } from '../../../src/index.js ' ;
77
88const 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) ;
You can’t perform that action at this time.
0 commit comments