You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: Cannot read property 'bind' of undefined when using Flow #5176
This is because Babel 7 changed the behavior of class properties so that an empty “definition” like this is treated as assigning undefined. AFAIK this is closer in behavior to the latest specification.
We’ll need to mention this in migration notes.
Still I’m not sure if this is correct. We’ll need more eyes on this.
@bugzpodder yep, that works, unfortunately, in my app, we use prettier which converts comments into standard type definitions. I think we'll wait to update CRA until this issue has been closed
Activity
gaearon commentedon Sep 30, 2018
This is because Babel 7 changed the behavior of class properties so that an empty “definition” like this is treated as assigning
undefined. AFAIK this is closer in behavior to the latest specification.We’ll need to mention this in migration notes.
Still I’m not sure if this is correct. We’ll need more eyes on this.
Some discussion: babel/babel#8417.
Apparently this could solve it? xing/hops@9cf7791
Maybe our preset should do this.
Gpx commentedon Sep 30, 2018
The thing is that Flow is asking me to add a type definition to
fooand I don't know how else to do itgaearon commentedon Sep 30, 2018
Yeah, I understand. We'll need to dig deeper into this.
Gpx commentedon Sep 30, 2018
Ok, thanks. Let me know if I can help somehow
bugzpodder commentedon Sep 30, 2018
@Gpx try this. This uses the flow commenting method. Obviously not ideal but it should provide with a workaround.
Gpx commentedon Sep 30, 2018
@bugzpodder yep, that works, unfortunately, in my app, we use prettier which converts comments into standard type definitions. I think we'll wait to update CRA until this issue has been closed