Fast Refresh - updated to 9.4.0, still hard refresh on save #12901
Replies: 3 comments 4 replies
-
Can confirm that this custom babel config prevents Fast Refresh from working:
|
Beta Was this translation helpful? Give feedback.
-
Could you provide some example code? Class components and unnamed function components will cause a full refresh. Also beware that higher order class components could cause it as well. I used that babel config with this repo from this discussion and Fast Refresh worked as expected. |
Beta Was this translation helpful? Give feedback.
-
Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React tree. You might have a file which renders a React component but also exports a value that is imported by a non-React component. Consider migrating the non-React component export to a separate file and importing it into both files. It is also possible you are using class components at the top-level of your application, which disables Fast Refresh. Fast Refresh requires at least one function component in your React tree. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to know why the application is still hard refreshing on save. Currently in my package.json I have:
"scripts": {
"start": "NODE_ENV=production node server.js",
"dev": "next dev",
"build": "next build",
"next": "next start"
}
Running next dev still gives hard refresh, any idea why? Do I need to include Fast Refresh in my config, or is there something possibly causing the hard refresh?
Beta Was this translation helpful? Give feedback.
All reactions