-
Notifications
You must be signed in to change notification settings - Fork 671
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
Add compatibility with React Fast Refresh #1440
Comments
That theme/index.js is just a big JavaScript object with a bunch of colors and styles inside, right? How does that conflict with Fast Refresh? |
Essentially, without Fast Refresh, changes trigger full reload (logs above). The same thing happens when the theme lives in |
Hi, just wanted to mention that this issue is most likely fully |
Hey @pieh great to hear! I'll be following your PR. |
Hey, @pieh I believe your Gatsby PR has been merged on v3, that's awesome! Thanks. |
Is your feature request related to a problem? Please describe.
react-refresh
is the successor forreact-hot-loader
While using Fast Refresh on a project, changes in the theme don't trigger HMR. Which make sense, since it's supposed to preserve the context and states.
Describe the solution you'd like
It would be nice to find a way, to have HMR work on theme changes, while using this feature. Not sure how we could go around this.
Describe alternatives you've considered
We could mention, the compatibility issue in the docs.
Gatsby now has a
FAST_REFRESH
flag, which makes it easy to break theme HMR.Additional context
You can test this out on a repro I did for another issue.
The text was updated successfully, but these errors were encountered: