Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using boilerplate with react-hot-loader/webpack loader #119

Open
arusakov opened this issue Feb 22, 2017 · 1 comment
Open

Using boilerplate with react-hot-loader/webpack loader #119

arusakov opened this issue Feb 22, 2017 · 1 comment

Comments

@arusakov
Copy link

arusakov commented Feb 22, 2017

I have made 2 simple changes in next branch:

  • remove plugins from .babelrc
  • add react-hot-reload/webpack to webpack.config.js

My git diff:

diff --git a/.babelrc b/.babelrc
index 9b921a0..0466330 100644
--- a/.babelrc
+++ b/.babelrc
@@ -3,8 +3,5 @@
     ["es2015", {"modules": false}],
     "stage-2",
     "react"
-  ],
-  "plugins": [
-    "react-hot-loader/babel"
   ]
 }
diff --git a/webpack.config.js b/webpack.config.js
index 67cccb4..e2e4d89 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -35,6 +35,7 @@ module.exports = {
       {
         test: /\.jsx?$/,
         use: [
+          'react-hot-loader/webpack',
           'babel-loader',
         ],
         exclude: /node_modules/,

And everything is fine, no errors, hot reloading is working expect state saving.
After every hot reloading state.counter become 0.

I don't know it is bug of react-hot-reload or it is bug of this configuration.

@calesce
Copy link
Collaborator

calesce commented Feb 22, 2017

We'd prefer people use the Babel loader. Can you share what was happening previously?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants