Skip to content

Commit

Permalink
fix(types): add xmlns:xlink to SVGAttributes (#9300)
Browse files Browse the repository at this point in the history
close #9299
  • Loading branch information
Alfred-Skyblue committed Dec 8, 2023
1 parent b1fe48d commit 0d61b42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/dts-test/tsx.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,11 @@ expectType<JSX.Element>(
)
// @ts-expect-error
;<Suspense onResolve={123} />

// svg
expectType<JSX.Element>(
<svg
xmlnsXlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
/>
)
1 change: 1 addition & 0 deletions packages/runtime-dom/src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
xlinkTitle?: string
xlinkType?: string
xmlns?: string
xmlnsXlink?: string
y1?: Numberish
y2?: Numberish
y?: Numberish
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/domAttrConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ export const isKnownSvgAttr = /*#__PURE__*/ makeMap(
`v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
`vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
`writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
`xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
`xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,` +
`xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
)

0 comments on commit 0d61b42

Please sign in to comment.