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
HMR does not work in modal #7248
Comments
I'm not familiar with
I tested the @pcattori unless you have any specific ideas for where Remix HMR might be causing this I'm thinking this may need to be investigated on the MUI side? |
I thought I might add that Vite and Next do not have this issue with the exact same modal setup. Unsure if it is a bug or just the nature how Remix's HMR works. Edit: |
I have a similar problem with modals, where HMR simply doesn't work (it refreshes the page). Just by having an OverlayProvider component from 'react-aria' as a parent component for the Outlet in root.tsx, is enough to stop HMR from working. Even if there is no modal using that provider. I will take a look at the implementation of the OverlayProvider myself, since I am still unsure whether that is a problem with that library or remix. EDIT: Here is the repro: https://github.com/dantxal/repro-issue-7248-remix |
Same thing happens for me -- it's most obvious in modals (which are always triggered by a setState call), but really all state gets blown away on any HMR update in my app. For me it was |
I wrote up some limitations of React Fast Refresh in the docs. Could be that things like But for issues that aren't reproducible in Vite nor Next, then the issue is most likely Remix-related, not a React Fast Refresh limitation. |
@pcattori I know at least for react-dnd, it doesn't use classes. I remember seeing something similar in vite, where contexts were breaking HMR. They did something to the react-refresh code to deal with this. |
I took a look into mui-modal-provider and it does not use classes either. |
What version of Remix are you using?
1.19.3
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Expected Behavior
Modal should stay open and text should get replaced.
Actual Behavior
Modal closes
The text was updated successfully, but these errors were encountered: