Skip to content
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

feat(runtime-dom): add xmlns:xlink to SVGAttributes #9300

Merged
merged 9 commits into from
Dec 8, 2023
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`
)