Replies: 1 comment
-
|
Please ignore this question. I've since figured it out, and it doesn't seem like I can delete this question. import React from 'react';
import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { RouterProvider } from 'react-router-dom';
import keycloak from './keycloak';
import router from './router';
import { store } from './redux/store';
import reportWebVitals from './reportWebVitals';
const initializeKeycloak = async (onAuthenticatedCallback: () => void) => {
try {
await keycloak.init(initOptions);
onAuthenticatedCallback();
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
const renderApp = async () => {
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<Provider store={store}>
<RouterProvider router={router} />
</Provider>
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
};
initializeKeycloak(renderApp); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Unfortunately, I'm stuck using
"keycloak-js": "^9.0.3"for the time being; however, I am in the process of rewriting our app to use"react": "^18.2.0".Are there any caveats to the tutorial when it comes to the aforementioned versions?
I see the logs I added to my
renderAppfunction, plus the logs from within the rendered<App>component, but weirdly, nothing is displayed in the UI. I don't see any errors. I've added an<ErrorBoundary>component, which seems to be moot since theAppcomponent function is effectively run. Anything come to mind?If I do this, the app displays properly:
It's not clear to me why it doesn't when
renderAppis invoked as theinitKeycloakcallback.keycloak.ts
Thanks in advance!
Noelle
Beta Was this translation helpful? Give feedback.
All reactions