Skip to content
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

Performs full reload and state loss in case of error #839

Open
jaspal-dev opened this issue May 13, 2024 · 2 comments
Open

Performs full reload and state loss in case of error #839

jaspal-dev opened this issue May 13, 2024 · 2 comments

Comments

@jaspal-dev
Copy link

I am using the module version 0.5.13. In case if app found an error (eg. accessing undefined.a ), it looses it state and performs full reload. Is this behaviour is default then how to tackle this one, just like CRA handle it.

@pmmmwh
Copy link
Owner

pmmmwh commented May 16, 2024

Hi, I cannot help unless there's a reproduction of what's happening. Depending on how your modules and code is structured it may or may not fallback to a full reload to ensure consistency.

@jaspal-dev
Copy link
Author

Hi

https://github.com/jaspal-dev/weather-app/blob/fix/react-refresh-issue/src/App.jsx
Please review this file. In this branch, you can also view the webpack and plugin configuration.

If I change a counter to counter1 or anything else in the file, the changes are reflected in the web app, which is expected.

But if I uncomment the code undefined.a as given in the file for throwing some error, after that, I uncomment it. The page reloads, and the state of the counter is lost.

After fixing any error, the state should be mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants