-
Notifications
You must be signed in to change notification settings - Fork 262
Using autobind entire class with react-transform-catch-errors leads to this.props
undefined in render()
method
#56
Comments
@weinot I tried to reproduce the issue with exactly the described code but it works as expected for me. Here's the source I used to try to reproduce: https://github.com/jayphelps/core-decorators-issue-56/blob/master/src/index.jsx Can you double check that this is indeed all the code you needed to reproduce? Are you using any other decorators as well? Which version of core-decorators and react? |
Do you have 15 minutes to do a Screenhero session so I can help you debug? I will probably be able to find the issue quickly since I'm intimately familiar with core-decorators internals and how they might interact with react. |
@jayphelps sorry for the later response, no other decorators are used but I use redux, react-redux and react-router in my project, maybe this causes the issue? following is the version i use Here is a demo project Thank you for your time. |
@weinot Your demo repo is perfect, I've been looking into it for a couple hours now and I know what the problem is just trying to find a good way to solve it without breaking the other situations. The reason you're hitting this bug is because the package react-transform-catch-errors, the way it wraps the render() method. That said, they aren't doing anything wrong, in fact a similar issue was reported a while ago and we solved it but this one is just a bit different. Will report back as soon as I have a solution. In the interim, you can either 1. use 😦 Creating a bug-free |
@jayphelps 👍 Thanks a lot. |
this.props
undefined in render()
methodthis.props
undefined in render()
method
…otype, not the class itself, fixes #56
@weinot fixed and published as |
For those reading later, this was tough to immediately track down without the real source code including build-pipeline because |
Here is the example
Maybe we could add an option to autobind named
dontBind
For example,
The text was updated successfully, but these errors were encountered: