https://github.com/hasanayan/craco-plugin-react-hot-reload
Adds the react-hot-loader to your create-react-app via craco
https://github.com/hasanayan/craco-plugin-react-hot-reload
Last synced: 8 months ago
JSON representation
Adds the react-hot-loader to your create-react-app via craco
- Host: GitHub
- URL: https://github.com/hasanayan/craco-plugin-react-hot-reload
- Owner: hasanayan
- Created: 2018-11-15T20:34:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-07T22:04:52.000Z (over 4 years ago)
- Last Synced: 2025-04-29T10:06:46.592Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 20
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - craco-plugin-react-hot-reload - hot-loader to your create-react-app via craco | hasanayan | 18 | (JavaScript)
README
# craco-plugin-react-hot-reload
**Prerequisites**
1. Install [craco](https://github.com/sharegate/craco)
2. [react-hot-reload](https://github.com/gaearon/react-hot-loader)
3. Regarding [this](https://github.com/gaearon/react-hot-loader#react--dom) install proper @hot-loader/react-dom


## Install
```
npm install craco-plugin-react-hot-reload --save-dev
```
## Usage
1. Add the plugin into your craco.config.js;
```
reactHotReloadPlugin = require('craco-plugin-react-hot-reload');
module.exports = {
plugins: [{
plugin: reactHotReloadPlugin
}]
}
```
2. Follow 'step 2' from https://github.com/gaearon/react-hot-loader , replicated below:
```js
Mark your root component as hot-exported:
// App.js
import React from 'react'
import { hot } from 'react-hot-loader'
const App = () =>
Hello World!
export default hot(module)(App)
```
## Acknowledgements
[@cdharris](https://github.com/cdharris) for having created [react-app-rewire-hot-loader](https://github.com/cdharris/react-app-rewire-hot-loader).
## License
Licensed under the MIT License, Copyright ©️ 2018 Hasan Ayan. See [LICENSE.md](LICENSE.md) for more information.