Skip to content

Reference incorrectly created for this within a JSXIdentifier #4055

@bradzacher

Description

@bradzacher

Repro

import React from 'react';

class Hello extends React.Component<{tag: () => React$MixedElement}> {
  inline() {
    return <this.props.tag />
  }
}

Expected Result

The this should be treated like a ThisExpression.

Actual Result

The this is treated like a variable called this, and thus creates an unclosed reference to a variable that can never exist.

Additional Info

Context: #3788 (comment)
cc @ljharb

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: scope-managerIssues related to @typescript-eslint/scope-manager

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy