Skip to content

Better JSX property error messages #23117

Closed
@mhegazy

Description

@mhegazy

JSX component property errors are limited in nature. seems like there is one of three categories:

  • missing required property
  • wrong property type
  • additional unknown property

Currently we rely on the assignablity error message which a. includes information about intrinsic types, react types, etc.. and b. does not pin point the offending property.
We can do better by reporting the errors on the specific property in cases of failed assignablity, and be more explicit about what it is that the user is doing wrong.. e.g. "Missed required property 'x'ortype of property 'y' does not match expected..

image

Related to #23116

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingDomain: 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