Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
EdmondChuiHW authored Apr 26, 2020
commit 5c4cf924dcf051ce04034df7b2b1135e93cb7f5d
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ Hot Module Replacement is [possible with this gem](https://stackoverflow.com/a/5

Similar to `useContext`, you can pass the webpack context into `useHotReload` to enable hot reload:
1. install [react-hot-loader](https://github.com/gaearon/react-hot-loader) and [@hot-loader/react-dom](https://github.com/hot-loader/react-dom)
1. add the following to your webpack config in dev:
2. add the following to your webpack config in dev:
```js
{
module: {
Expand All @@ -703,7 +703,7 @@ Similar to `useContext`, you can pass the webpack context into `useHotReload` to
},
}
```
1. in your entry file, usually where you call `ReactRailsUJS.useContext` already, call `useHotReload`:
3. in your entry file, usually where you call `ReactRailsUJS.useContext` already, call `useHotReload`:
```js
var ReactRailsUJS = require("react_ujs")
var myCustomContext = require.context("custom_components", true)
Expand Down