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: useScript failed to remove script from cache when passing removeOnUnmount prop #354

Merged
merged 5 commits into from
Feb 3, 2024

Conversation

ShanSenanayake
Copy link
Contributor

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.

Issue: #314

…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-bot
Copy link

changeset-bot bot commented Jul 20, 2023

🦋 Changeset detected

Latest commit: de6a350

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
usehooks-ts Patch
www Patch

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

@vercel
Copy link

vercel bot commented Jul 20, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @juliencrn on Vercel.

@juliencrn first needs to authorize it.

@scottwiw
Copy link

Any bump on this? Ran into this issue while trying to add a Hubspot calendar iframe and this definitely fixes it.

@ShanSenanayake
Copy link
Contributor Author

@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 useScript and fixing it yourself.

@scottwiw
Copy link

@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 useScript and fixing it yourself.

Thanks, I'll make do. Appreciate it!

@juliencrn juliencrn added the bug Something isn't working label Jan 19, 2024
@juliencrn
Copy link
Owner

Thank you @ShanSenanayake 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants