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

Literal this Evaluation and Derivative References #88

Open
thescientist13 opened this issue Aug 10, 2022 · 0 comments
Open

Literal this Evaluation and Derivative References #88

thescientist13 opened this issue Aug 10, 2022 · 0 comments
Assignees
Labels
expirement feature New feature or request JSX
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Aug 10, 2022

Type of Change

  • New Feature Request

Summary

Coming from #84 , wanted to track support for having something like this

render() {  
  return (
    <h1>You have {this.todos.length} TODOs left to complete</h1>
  )
} 

Details

I think I was getting this error though when I tried

ReferenceError: __this__ is not defined

I think this would also handle other cases like this, but will need to double check

render() {
  const { user } = this;
  
  return (
    <button onclick={(e) => { this.deleteUser(user.id) }}>Delete User</button>
  )
}

Also would be good handle derivative this references as well, but also make sure we don't track them for observability either. Just make sure we are looking for this in all possible places, e.g.

render() {
  const { count, predicate } = this;
  const conditionClass = predicate ? 'met' : 'unmet';

  return (
    <span class={conditionClass}>{count}</span>
  )
}
@thescientist13 thescientist13 added feature New feature or request expirement JSX labels Aug 10, 2022
@thescientist13 thescientist13 changed the title Literal this Evaluation Literal this Evaluation and Derivative References Jan 4, 2023
@thescientist13 thescientist13 added this to the 1.0 milestone Jan 4, 2023
@thescientist13 thescientist13 self-assigned this Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expirement feature New feature or request JSX
Projects
None yet
Development

No branches or pull requests

1 participant