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

react-hot-loader doesn't work with class properties #695

Closed
lili21 opened this issue Nov 14, 2017 · 3 comments
Closed

react-hot-loader doesn't work with class properties #695

lili21 opened this issue Nov 14, 2017 · 3 comments
Assignees

Comments

@lili21
Copy link

lili21 commented Nov 14, 2017

Description

can not update state within function which is defined with class properties style.

Expected behavior

this.setState should update the state.

Actual behavior

this.setState does work as expected.

Environment

React Hot Loader version: 3.1.2

Run these commands in the project folder and fill in their results:

  1. node -v: v8.5.0
  2. npm -v: 5.4.2

Then, specify:

  1. Operating system: macOS Sierra 10.12.6
  2. Browser and version: Chrome 62.0.3202.89 (64bit)

Reproducible Demo

demo

@theKashey
Copy link
Collaborator

Actually, the problem is another - the "real" arrow function does not work at all. They are updating the real component, not the used(proxy) one.
See: #662, #686
The possible solution is still in testing. Meanwhile, just don't use env plugin - transpile arrow functions back to es5.

@theKashey theKashey self-assigned this Nov 14, 2017
@lili21
Copy link
Author

lili21 commented Nov 14, 2017

Thanks for that.

@gregberge
Copy link
Collaborator

Will be fixed in React Hot Loader v4. I close it because it is a duplicate.

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