Hook issues using @prefresh/nollup
See original GitHub issueI came across an issue where the state is not being persisted when using components defined in the same file. It compiles and runs, but once prefresh and nollup injects new code for it, the hook state is reset to 0. Preact example provided here
Another related issue is when using hooks like useMemo
inside components like here.
It exhibits Uncaught TypeError: undefined is not a function
or Uncaught (in promise) TypeError: $RefreshSig$ is not a function
when HMR injects this code.
I did verify that this works properly with the react-refresh example, so I guess these are related to the @prefresh/nollup plugin. Maybe this is @PepsRyuu’s domain? 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Issues · react-hook-form/react-hook-form - GitHub
ProTip! Find all open issues with in progress development work with linked:pr.
Read more >Git pre-push hook not working - Stack Overflow
pre-push.sh isn't a valid hook name. Instead this needs to be placed on the server as a pre-receive hook. OK - never used...
Read more >Can We All Just Admit React Hooks Were a Bad Idea? Part 3
No, I'm not going to identify the library, because I think that every library would have this same problem unless they wanted to...
Read more >Troubleshooting & Debugging Hooks - Guides & Tutorials
Guides & Tutorials. Browse our easy to follow guides and tutorials that demonstrate how to use WHMCS and resolve common problems.
Read more >React Hooks Closure Problems - YouTube
I go over an issue you may face when using React hooks that has to do with closures.Code: https://codesandbox.io/s/angry-bush-4165dLinks ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hanswilw Fixed in https://github.com/JoviDeCroock/prefresh/pull/131/files
That should not change the signature so there could be a bug there, I’ll check it out later