React-hot-loader: does not respect public field binding

Created on 28 Apr 2017  路  2Comments  路  Source: gaearon/react-hot-loader

Description

What you are reporting:

  • A bug

Expected behavior

What you think should happen:

handleClose should be called with the current context of the component.

Actual behavior

What actually happens:

handleClose is called with the old context of the container.

Environment

React Hot Loader version:

^3.0.0-beta.6

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

  1. node -v: v7.9.0
  2. npm -v: v4.2.0

Then, specify:

  1. Operating system: OS
  2. Browser and version: Chrome v58

Reproducible Demo

git clone [email protected]:gajus/sanity-test.git
cd ./sanity-test
npm run install
npm run dev

Click "Click me" button.

Expected result: movie prop is not null.
Curent result movie prop is null.

Additional information

The lack of context binding is visible in the code transpilation difference without/ with react-hot-loader/babel https://gist.github.com/gajus/2d0867f326d5c69702f057c7cd7cf15f/revisions

bug

Most helpful comment

The real issue is documented here. https://github.com/gaearon/react-proxy/issues/69

All 2 comments

The real issue is documented here. https://github.com/gaearon/react-proxy/issues/69

I have tested it with React Hot Loader v4 and it is now fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jljorgenson18 picture jljorgenson18  路  3Comments

theKashey picture theKashey  路  4Comments

zlk89 picture zlk89  路  3Comments

sandysaders picture sandysaders  路  4Comments

mqklin picture mqklin  路  3Comments