-
Notifications
You must be signed in to change notification settings - Fork 59
How to get React Fast Refresh to work #98
Comments
If you look at the
After installing these two dependencies, you should be able to do the following: const {appendWebpackPlugin} = require(@rescripts/utils);
const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const isDevelopment = process.env.NODE_ENV !== "production";
module.exports = [
['use-babel-config', '.babelrc'],
isDevelopment
? [appendWebpackPlugin(new ReactRefreshPlugin(...yourOptions))]
: config => config
] Finally, specify the [
"plugins": [
"react-app",
"react-refresh/babel"
]
] Please try this out and let me know if you need more help |
@harrysolovay It works pretty well on a Thank you for this great project! By the way, only a small typo in your answer 😄 - const {appendWebpackPlugin} = require(@rescripts/utils);
+ const {appendWebpackPlugin} = require('@rescripts/utilities') |
Hi @harrysolovay Excuse me, but I just found it very strange
Maybe I should dive deep into the code, but do you have any guess about why doesn't it work? Thanks so much for your help ❤️ |
Hi all,
The
React Fast Refresh
is much better thanHMR
, and here isuse-rewire
: https://dutzi.party/react-fast-refresh/react
issue: How should we set up apps for HMR now that Fast Refresh replaces react-hot-loader? facebook/react#16604I guess I need to use
But I don't know how to write in a
rescript
way.Can anyone have a try and help me ?
Thanks so much ❤️
The text was updated successfully, but these errors were encountered: