facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
223.76k stars 45.56k forks source link

[React 19] `transformOrigin` is Missing From Type `SVGAttributes`. #29134

Open daniel-nagy opened 2 weeks ago

daniel-nagy commented 2 weeks ago

Summary

In React 18 the following code worked with out error.

<svg transform-origin="..." />

Since React 19, this will error. The required syntax is now

<svg transformOrigin="..." />

However, transformOrigin is missing from SVGAttributes, so this results in a type error.

I was going to open a PR to add this but the types package for React 19 appears to be private.

Workaround

declare module "react" {
  interface SVGAttributes<T> {
    transformOrigin?: string | undefined;
  }
}