This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Whenever you're working with web-components and nextjs in development mode, it is possible that the "Fast Refresh" feature | |
* of nextjs don't re-render your web-component. It's a little bit stressful that you have to reload the page manually every time | |
* you update something. (thats why we have HMR and nextsjs Fast Refresh) | |
* | |
* For anyone in need of a way to force the full page reload whenever the "Fast Refresh" occurs, I've made a simple snippet that | |
* uses nextjs internal websocket to listen for that. | |
* | |
* One potential downside to this approach is that it relies on internal functionality of Next.js, | |
* which could potentially change in future versions and break your code. However, as long as you're |