-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[react] Add crossOrigin to SVGAttributes #40880
[react] Add crossOrigin to SVGAttributes #40880
Conversation
@icosahebron Thank you for submitting this PR! 🔔 @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @eps1lon @zieka - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
@@ -2259,6 +2259,7 @@ declare namespace React { | |||
// Other HTML properties supported by SVG elements in browsers | |||
role?: string; | |||
tabIndex?: number; | |||
crossOrigin?: "anonymous" | "use-credentials" | ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of the blank string as an allowed value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blank string appears in the <img>
equivalent:
DefinitelyTyped/types/react/index.d.ts
Line 1957 in 833391a
crossOrigin?: "anonymous" | "use-credentials" | ""; |
and when used as an attribute value, is treated the same as anonymous
Setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous.
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
👍 |
I just published |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).If changing an existing definition:
React supports SVG
<image>
elements with acrossOrigin
prop. It even special-cases that prop so that it's rendered as an all-lowercase attribute in HTML (see facebook/react#14832).This PR updates
@types/react
to reflect this, letting us write:instead of workarounds like: