-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Fix:- Improve HOC support and state preservation in React Refresh #30660
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@gaearon did you encounter this error? if yes could you help me out if this fix looks right. |
cc @josephsavona |
Hey @Biki-das, apologies for a long wait. I think we should find an owner for |
hi @hoxyq 😅 no worries, i understand the team have other priorities and i guess dan was requested for review while ago, but since he is no more actively a part of the react team, so might not be something that gets attention, yeah the last change was long back, but this seems to be an important bug that shall be fixed as this occurs in Nextjs as well. |
@hoxyq whenever you return and if you are a bit less busy, could you forward this further to someone who might have idea about react refresh, feel like this fix could be important. |
@eps1lon any thoughts on who can review this, i see react refresh has not been touched for a long time? could we get someone to review this if you know someone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, and changes make sense, few points:
- Could you please retitle this PR to something that describes what's being added to Fresh?
- Could you please add tests that will check that state is not preserved when switching between different wrappers?
@hoxyq thanks for the feedback sure i will try to add the required tests and change the PR title as well. |
65935b0
to
94387b6
Compare
@hoxyq let me know if the new tests added are what you expected, and the reset test is running fine, we have a playwright test fail which is non related to this commit. looking forward to your thoughts |
also nothing new is added to Fresh, these are the changes Added special handling for React.forwardRef and React.memo components |
Summary
This fixes #30659 , the issue was how the state was preserved and needed special cases for the forward and memo, have also added tests related to the same.
How did you test this change?
yarn test packages/react-refresh/src/__tests__/ReactFresh-test.js