Búsqueda de sitios web

typescript - ¿Cómo declarar el tipo de propiedades SVG en Astro + Preact?


Estoy tratando de declarar un tipo para las props de svg, pero obtengo un error de tipo al hacerlo:

---
import type { SVGProps } from "preact/compat";

interface Props extends SVGProps<SVGElement> {
  class?: string;
}

const { class: className, ...props } = Astro.props;
---

<svg
  xmlns="http://www.w3.org/2000/svg"
  viewBox="0 0 87 97"
  class={className}
  fill="none"
  {...props}
>
Type 'string | SignalLike<string | undefined> | undefined' is not assignable to type 'string | null | undefined'.
  Type 'SignalLike<string | undefined>' is not assignable to type 'string'.ts(2322)
astro-jsx.d.ts(1318, 3): The expected type comes from property 'xmlns' which is declared here on type 'SVGAttributes'
(property) astroHTML.JSX.SVGAttributes.xmlns?: string | null | undefined