-
-
Notifications
You must be signed in to change notification settings - Fork 421
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: useScript failed to remove script from cache when passing removeOnUnmount
prop
#354
Conversation
…eOnUnmount` prop The `removeOnUnmount` prop didn't remove the script from the cache. This created a side effect where if you try and render the same component by mounting -> unmounting -> mounting again, the `useScript` hook behaves as the script is loaded when in reality is has remove the script from the tree but failed to remove it from the cache.
🦋 Changeset detectedLatest commit: de6a350 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Someone is attempting to deploy a commit to a Personal Account owned by @juliencrn on Vercel. @juliencrn first needs to authorize it. |
Any bump on this? Ran into this issue while trying to add a Hubspot calendar iframe and this definitely fixes it. |
@scottwiw based on this issue, and the amount of PRs that has no activity I think this package is basically abandoned, I would suggest co locating the whole |
Thanks, I'll make do. Appreciate it! |
Prefer `cache.delete(key)` to `delete cache[key]`
Thank you @ShanSenanayake 👍 |
The
removeOnUnmount
prop didn't remove the script from the cache. This created a side effect where if you try and render the same component by mounting -> unmounting -> mounting again, theuseScript
hook behaves as the script is loaded when in reality is has remove the script from the tree but failed to remove it from the cache.Issue: #314