-
Notifications
You must be signed in to change notification settings - Fork 198
Question RE: adding/removing hooks... #4
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
Comments
Hey! Thanks for the issue. I just shipped |
I tried again with the latest released version and on master (nice overlay!), but do still see things error out when I add/remove hooks. Sorry for not adding a simple test, but simply adding/remove the following from a
It's not a big deal at this point (just an extra reload I can trigger by making more edits). I was mainly curious about whether this is the expected normal behavior. Thanks! |
I'll have to check if I did something wrong. I am pretty sure state/reducer/refs work, let me check. |
No |
I couldn't reproduce this in a normal webpack app. I guess it might have something to do with integration between this and CRA. #7 |
As mentioned in #25, I can resolve this in my CRA app by setting |
Fixed in |
I've been trying this plugin out on a few CRA-based projects (based on steps mentioned here). So far, things work well in terms of preserving state during development as I edit my components and hooks.
Question: Anytime I add or remove hooks, I get the an error stating that the number of hooks has changed between renders. The component is not re-mounted. I have to force a subsequent reload to recover. Is this the expected behavior at the moment?
Expectation: Similar to the behavior when using Dan's old
wonky-scripts
experiment, adding/removing hooks should gracefully force a remount of the component if necessary rather than just bubbling the error all the way up.I see the same behavior if I eject the CRA app and manually edit the webpack config per the README as well as if I use the feature branch version that hasn't yet been merged back to master.
Thanks for the work being put into bringing such a great React feature to web setups!
The text was updated successfully, but these errors were encountered: