-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Can crash the application
layoutContexts.tsx:
useEffect(() => {
if (
(path === '/nestify' || path.includes('development-tools')) &&
Gleap.getInstance().initialized //
) {
Gleap.destroy();
} else if (
!Gleap.getInstance().initialized && //
path !== '/nestify' &&
!path.includes('development-tools')
) {
Gleap.setUseCookies(true);
Gleap.initialize(process.env.GLEAP_API_KEY || '');
}
}, [path, Gleap.getInstance().initialized]); //
Issue: Gleap.getInstance().initialized in the dependency array returns a new reference on each render, causing infinite re-renders.
Fix: Store the initialized state in a variable or remove from dependencies.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels