Skip to content

Commit

Permalink
Switch to React Fast Refresh by default
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Jan 12, 2023
1 parent c59de72 commit 284731c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/crafty-preset-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
app: {
runner: "webpack",
source: "js/app.js",
hot: true, // Hot Module Replacement must be enabled for React Hot Loader to work
hot: true, // Hot Module Replacement must be enabled for any kind of reload to work
react: true // React features must be enabled per bundle
}
}
Expand Down Expand Up @@ -96,6 +96,7 @@ To enable it, add these two parameters to your bundle in `crafty.config.js`:

You're now ready to run `crafty watch` and use Fast Refresh on all your components.

> If you are importing React through Requirejs or other ways that aren't controlled by Webpack, make sure that you are using the development version while running in watch mode, otherwise no refresh will be applied.
### React Hot Loader

Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
// the configuration
if (bundle.react && typeof bundle.react === "boolean") {
bundle.react = {
refreshMode: "hot" // fast-refresh is opt-in for now, default to hot
refreshMode: "fast"
};
}
},
Expand Down

0 comments on commit 284731c

Please sign in to comment.