diff --git a/babel.config.js b/babel.config.js
index 9147a8f..03eabfa 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,7 +1,5 @@
'use strict';
-// "react-hot-loader/babel"
-
const presets = [
[
'@babel/preset-env',
@@ -17,6 +15,7 @@ const presets = [
];
const plugins = [
+ 'react-hot-loader/babel',
[
'@babel/plugin-transform-runtime',
{
diff --git a/src/components/Root.js b/src/components/Root.js
index dc96e22..e69e776 100644
--- a/src/components/Root.js
+++ b/src/components/Root.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Provider } from 'm/store';
import { HashRouter as Router, Route } from 'react-router-dom';
-// import { hot } from 'react-hot-loader';
+import { hot } from 'react-hot-loader/root';
// import createHistory from 'history/createHashHistory';
// import createHistory from 'history/createBrowserHistory';
import ErrorBoundary from 'c/ErrorBoundary';
@@ -45,11 +45,4 @@ const Root = () => (
//
//
-// hot export Root
-// https://github.com/gaearon/react-hot-loader/tree/v4.0.1#getting-started
-
-// RHL doesn't compatible with React Hook yet, see:
-// https://github.com/gaearon/react-hot-loader/issues/1088
-// after it's working, uncommment below line and remove "//" in the babelrc
-// export default hot(module)(Root);
-export default Root;
+export default hot(Root);
diff --git a/yarn.lock b/yarn.lock
index 1399f2b..7e8fa09 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2430,7 +2430,14 @@ debug@^3.1.0:
dependencies:
ms "^2.1.1"
-debug@^4.0.1, debug@^4.1.0:
+debug@^4.0.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
+ integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
+ dependencies:
+ ms "^2.1.1"
+
+debug@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87"
integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==
@@ -2919,9 +2926,9 @@ eslint-visitor-keys@^1.0.0:
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
eslint@^5.7.0:
- version "5.10.0"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.10.0.tgz#24adcbe92bf5eb1fc2d2f2b1eebe0c5e0713903a"
- integrity sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ==
+ version "5.11.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.0.tgz#51a0e70f137a425fe044cd48273b96f28a774b1f"
+ integrity sha512-gbEg0ttToZPkZUv2yYjpipxuYrv/9aSSmgM4V6GkiO3u04QosHYBtduUCqLEulEg3YvNDAkk3OWzyQJ/heZ3Nw==
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.5.3"