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

This is maybe a bug. #387

Closed
samonxian opened this issue Sep 29, 2016 · 4 comments
Closed

This is maybe a bug. #387

samonxian opened this issue Sep 29, 2016 · 4 comments

Comments

@samonxian
Copy link

�React Hot Loader work correctly,But after Hot-reload,it will has warning like below.

warning.js:36 Warning: setState(...): Can only update a mounted or mounting component.
This usually means you called setState() on an unmounted component. This is a no-op. 
Please check the code for the Component component.

Demo is here.,please see demo13.

@calesce
Copy link
Collaborator

calesce commented Oct 1, 2016

Hi, I don't see react-hot-loader/patch anywhere in demo13. Try putting that in entry of your Webpack config.

@calesce calesce closed this as completed Oct 1, 2016
@samonxian
Copy link
Author

samonxian commented Oct 8, 2016

I put react-hot-loader/patch in the entry, but it's no use when using require.ensure.See Demo 13 again.

@calesce
Copy link
Collaborator

calesce commented Oct 8, 2016

Ah yes, there's a known issue with require.ensure, see #288. The workaround is to add extra module.hot.accept callbacks for each separate module (which is annoying).

System.import may be a good alternative if you can use Webpack 2, see #303 (comment).

@penx
Copy link

penx commented Sep 12, 2017

I had this issue when trying to switch from babel-preset-es2015 to babel-preset-env. Adding transform-es2015-classes to the included transforms resolved it for me:

presets: [
  ['env', {
    targets: {
      chrome: 60
    },
    include: ['transform-es2015-classes']
  }],
  'stage-1',
  'react'
],
plugins: ['react-hot-loader/babel'] 

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

3 participants