natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
1.01k stars 57 forks source link

Simplify `Props` with ` astroHTML.JSX.SVGAttributes` #43

Closed JulianCataldo closed 6 months ago

JulianCataldo commented 2 years ago

Hello!

Maybe this:

/// <reference types="astro/astro-jsx" />

export interface Props extends astroHTML.JSX.SVGAttributes {
 ...
}

Could now simplify the Props part of this component? With the benefit of Astro ecosystem homogenization.

stramel commented 1 year ago

Was able to simplify it to:

/// <reference types="astro/astro-jsx" />
type SVGAttributes<T extends EventTarget> = Omit<astroHTML.JSX.SVGAttributes<T>, 'stroke-miterlimit'>
export interface Props<T extends EventTarget = any> extends SVGAttributes<T>  {