Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix intermittent loading issue #714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Schlickmann
Copy link

Hey folks, there is this bug reported here and I've been facing the same intermittently and debugging the project we found that the event listeners were being removed before the script finished loading.

Removing those lines of code the loading issue stops happening.

Copy link

vercel bot commented Feb 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-google-charts-v2 ❌ Failed (Inspect) Feb 1, 2024 0:24am

@wavebeem
Copy link

wavebeem commented Feb 1, 2024

Hello! I was working on this with @Schlickmann and wanted to add my thoughts about the fix.

It's probably always the right thing to remove an event listener when a useEffect is done, but for some reason that's causing an infinite loading bug for us. I didn't understand the code well enough to pursue a more specific fix.

The "best" solution might be more involved than this, but this does seem to work. Additionally, I would think this won't leak very many event listeners, since subsequent loads will find the script tag already in the DOM. I would expect this to leak a finite amount of event listeners across repeated page navigation because of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants