Bug: Fast Refresh crashed when wrapping function in memo. #24710
Labels
Resolution: Stale
Automatically closed due to inactivity
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug


As described in this issue: vercel/next.js#37241
React version:
^18Steps To Reproduce
I can reproduce this issue in next.js, react-scripts and vite, here are the reproducible repositories:
functiontoReact.memo:edit code in
Test.jsx:change it to:
you can see the error in your browser console:

After manually refreshing the page and changing the code back to the original, there was no error, but the hot update did not work at all.
functiontoReact.forwardRef:Same result as in step 1.
React.memotoReact.forwardRef:change component
Testfromto
Hot update has no effect, the page shows the result before modification.
Link to code example:
The current behavior
As described above.
fast-refresh-issue.mp4
The expected behavior
Fast Refresh works fine when changing component types.
The text was updated successfully, but these errors were encountered: