Open VijayaSaiRam opened 1 month ago
@VijayaSaiRam - can confirm that this library works okay with react 18. See:
Your issue may be elsewhere, but it's hard to tell from the snippet you provided.
Can you provide a minimal reproducible example?
I have upgraded to "react": "^18.3.1", "react-dom": "^18.3.1",
and to fix the warning [Deprecation notice: ReactDOM.render is no longer supported in React 18]
I have changed code in index.js to as follows. import React, {StrictMode} from 'react'; import ReactDOM from 'react-dom'; import { createRoot } from 'react-dom/client';
After that authentication is not progressing further.
it is always in the sprinner loading
It is just getting the access code, after that token call is not happening, it always stays in the following code useEffect(() => { if (!auth.isAuthenticated && !auth.error && !auth.isLoading) { auth.signinRedirect(); } if (auth.error) { authenticaionFailed(); } if (auth.isAuthenticated && auth.user) { authenticationPassed(auth.user); } auth.events.addSilentRenewError(error => { if (AUTH_MESSAGES.indexOf(error.message) !== -1) { setShowTimeoutModal(true); } else { authenticaionFailed(error); } }); if (!authenticating && userInfo) { if (scopes.length < 1) { navigate(ERROR_PAGES.noAccessError.path); } else if (//custom condition) { // execute else if block } } // eslint-disable-next-line react-hooks/exhaustive-deps }, [authenticating, auth.isAuthenticated, auth.error, auth.isLoading, auth.user]);
If I comment
Even if I don't fix the warning [Deprecation notice: ReactDOM.render is no longer supported in React 18] and leave the code as such
then it is working.
After that authentication is not progressing further. it is always in the sprinner loading
Is this "spinner" from Keycloak, or from your React app?
If it's from your React app, what is the code that toggles this spinner?
I have upgraded to React 18. after that when I load the page, it is not coming out of the loading spinner, authentication is not working. const root = createRoot(document.getElementById('root')); root.render(