Skip to content

JsxTagNameExpression can only be Identifier | ThisExpression, not any PrimaryExpression - #21555

Merged
7 commits merged into
masterfrom
jsxtagnameexpression
Jun 29, 2018
Merged

JsxTagNameExpression can only be Identifier | ThisExpression, not any PrimaryExpression#21555
7 commits merged into
masterfrom
jsxtagnameexpression

Conversation

@ghost

Copy link
Copy Markdown

Noticed this while looking at some jsx-using code -- we were typing this as PrimaryExpression but could be a lot more strict.

@uniqueiniquity

Ben Lichtman (uniqueiniquity) commented Feb 1, 2018

Copy link
Copy Markdown
Contributor

I mean, while you're at it, it seems like PropertyAccessExpression is not particularly strict either, given JSXMemberExpression in https://github.com/facebook/jsx/blob/master/README.md. I think your change is fine but I would recommend waiting for someone more familiar with our grammar to agree.

@rbucktonRon Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but as Ben Lichtman (@uniqueiniquity) mentioned, if we're that concerned about strictness here then we would probably want to add a:

exporttypeJsxTagNameExpression=Identifier|ThisExpression|JsxMemberExpression;exportinterfaceJsxMemberExpressionextendsPropertyAccessExpression{expression: JsxTagNameExpression;}

@ghost

Copy link
Copy Markdown
Author

I think we could just use EntityNameExpression | ThisExpression, but let's wait on #21588 first.

@ghost

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the jsxtagnameexpression branch from 909cc64 to a441800CompareFebruary 5, 2018 22:29
@typescript-bot

Copy link
Copy Markdown
Contributor

Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it.

@ghost

Copy link
Copy Markdown
Author

@ghost
ghost merged commit c5bd040 into masterJun 29, 2018
@ghost
ghost deleted the jsxtagnameexpression branch June 29, 2018 23:50
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@uniqueiniquity@typescript-bot@rbuckton