-
Notifications
You must be signed in to change notification settings - Fork 801
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
[3.0] Saving the value of 'this' is broken in class constructor but works with transform-es2015-classes #313
Comments
This seems related to #242. If it's not supported at all, I wonder, then, why did it (appear to?) work when |
I'm seeing this as well. The React docs recommend this pattern of reassigning functions in the constructor for a couple of purposes: But even the presence of I created a repro repo here before I realized that this was the same issue. |
Came across this today while doing some work integrating If someone can point be in a good direction I'll be happy to dive into this at some point and get it sorted. |
@MarshallOfSound it's the issue of react-proxy. If you wanted to start with this, just try to do a simple proxy object (with |
@wkwiatek OK so I spent a while inside of |
Is there a workaround for those of us who are experiencing this issue today? |
I had this issue when trying to switch from
|
This is a known problem, we have to update babel plugin to handle native classes. Help welcome! |
+1 |
Also looking for a fix here! |
+1 |
Fixed in v4. Also added a modern example. |
The code in the following gist (which happens to be based on the example at facebook/react#7094 (comment)) explains the issue in more detail:
https://gist.github.com/Kovensky/0ce87560e4b3c93cd77475fdcf94b610
Using
[email protected]
. Note that the component in that gist is not inside anAppContainer
, but the "real world" version of it ultimately is, and that one also has the same error behaviour.The same problem also happens when using
transform-class-properties
and arrow function properties, as they're bound at construction time.The text was updated successfully, but these errors were encountered: