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