-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
@g-saracca shared with me the following tip for disabling double network calls in React:
% git diff src/index.tsx
diff --git a/src/index.tsx b/src/index.tsx
index 534a26ff..ff2b7fc1 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -4,7 +4,7 @@ import { KcPage } from './keycloak-theme/kc.gen'
const AppEntrypoint = lazy(() => import('./index.app'))
createRoot(document.getElementById('root') as HTMLElement).render(
- <StrictMode>
+ <>
{window.kcContext ? (
<KcPage kcContext={window.kcContext} />
) : (
@@ -12,5 +12,5 @@ createRoot(document.getElementById('root') as HTMLElement).render(
<AppEntrypoint />
</Suspense>
)}
- </StrictMode>
+ </>
)
This change should not be committed but it's helpful in development to reduce the noise.
We should explain this in the dev guide or make it a config option, if possible.
Metadata
Metadata
Assignees
Labels
No labels