question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hook issues using @prefresh/nollup

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
JoviDeCroockcommented, Aug 3, 2020

That should not change the signature so there could be a bug there, I’ll check it out later

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found