-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
Using a reserved word as the name of an intrinsic element triggers the error Identifier expected. '<word>' is a reserved word in strict mode.
. This is similar to #17452.
I'm happy to submit a PR, but I am not familiar with this path, so I'd need guidance on where to look / what to consider.
🔎 Search Terms
reserved word intrinsic elements tsx
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
⏯ Playground Link
Playground link with relevant code
💻 Code
declare const React: any;
declare module JSX {
interface IntrinsicElements {
["package"]: any;
}
}
function Xml() {
return <package />;
}
🙁 Actual behavior
error thrown
🙂 Expected behavior
no error since ultimately intrinsic elements become static strings or stay in jsx format
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this