Skip to content

Error range for JSX components spans the whole compoenent  #23116

Closed
@mhegazy

Description

@mhegazy

Missing attribute error highlights the whole component, which can be distracting, and does not help in pointing out the source of the problem. We should instead highlight the component name in these cases.

import React from "react";

export class MyComponent extends React.Component<{ abc: number }> {
}
 
<MyComponent
    key="hi"
    AnotherProperty="ss"
    YetAnotherProperty={
        {
            a: 0,
            b: "ss"
        }
    }
/>

image

Originally reported in https://twitter.com/keeskluskens/status/981168047204458501

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions