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

"this" references are no longer transformed correctly in some cases #111

Closed
nicketson opened this issue Feb 16, 2022 · 2 comments
Closed

Comments

@nicketson
Copy link
Contributor

The issue can be seen here

The expression this.shouldStay here

<Component prop={this.something} onClick={() => this.shouldStay}>

should be transformed into _self$.shouldStay here

this is going to refer to the object literal being passed as the second argument to _$createComponent() instead of the this in the render function, which is what would be expected.

The bug was introduced in commit f8ea5cc

@ryansolid
Copy link
Owner

Interesting because it looks like that commit was very intentional to fix a different issue. Trying to track down that issue now, but it is proving elusive.

@titoBouzout
Copy link
Contributor

titoBouzout commented Mar 12, 2022

Isn't the issue that the getters are using the current scope instead of the parent?
related ryansolid/mobx-jsx#44
curious enough, at the time I sent that issue, it only happens when you double nest a custom component, it doesn't happen if you double nest a regular div.

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