Fast Refresh for React 17 #28390
Replies: 2 comments 2 replies
-
Do we need to remove the hot-reload entry gatsby-node.js? Is there a sample for this flag available? |
Beta Was this translation helpful? Give feedback.
2 replies
-
We've enabled Fast Refresh by default now in version 3.0: https://www.gatsbyjs.com/docs/reference/release-notes/v3.0#fast-refresh Thanks everyone for testing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Released in v3.0: https://www.gatsbyjs.com/docs/reference/release-notes/v3.0#fast-refresh
Description
With release
2.28.0
we shipped major improvements to our Fast Refresh support. The PR for a preliminary Fast Refresh integration added a custom overlay, better error recovery and in general a better communication between Gatsby's dev server and React Fast Refresh.As Gatsby still supports older versions of React than 16.9 or 17.0 we can't enable it by default for everyone just yet. In the next major we definitely want to switch to Fast Refresh only -- for now you'll need to toggle a flag. Until the general release for everyone we want your feedback on the current implementation when you use it. In release
2.29.0
we'll enable it by default for everyone on React >= 17.0.Usage
If you're on 16.9 or 17.0 you can enable it by setting a flag inside your
gatsby-config.js
(you'll need to be on the latest version of Gatsby):You can also drop the usage/installation of
hot-loader
e.g. in your gatsby-node.js file.Preview
Build/Webpack error
Runtime error
Beta Was this translation helpful? Give feedback.
All reactions