-
Notifications
You must be signed in to change notification settings - Fork 114
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
Stops working after Next.js Fast Refresh #54
Comments
Hi @nfantone, thank you for the issue I mean, the following code wouldn't work properly:
In the example above, we change ref to the truth inside useEffect cleanup function (which is handy to prevent unnecessary timers, callbacks, etc). I've fixed it, by publishing a new version: Here is an example of such fixes, I hope it could be helpful: 2ac1732 Also, I've fixed the example by updating the version of use-debounce: https://codesandbox.io/s/hungry-architecture-4z46m?file=/pages/index.js (so that it works now) |
Great stuff! It seems to work fine now. Many thanks for this, appreciated. Good work! |
use-debounce
stops working altogether after any changes to code are made in a Next.js project.You can see a reproduction example here: https://codesandbox.io/s/hardcore-sara-ueu2k
Looks fine on first load, but doesn't call the input callback anymore after refresh.
After initial load
After [Fast Refresh] done
Some people are commenting similar situations over at the Next.js repo, experiencing breaking libs after they decided to rolled out their new "Fast Refresh" implementation. Oftentimes, these ended up being undiscovered bugs in the original libraries rather than a problem with Next.js itself.
The text was updated successfully, but these errors were encountered: