Fix type error of preact createLucideIcon() (#1754)

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
This commit is contained in:
Han Yeong-woo
2023-12-28 14:28:15 +01:00
committed by GitHub
co-authored by Eric Fennis
parent d9d7e245a3
commit e3166c65df
2 changed files with 4 additions and 2 deletions
@@ -25,7 +25,7 @@ const createLucideIcon = (iconName: string, iconNode: IconNode): FunctionCompone
{ color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth, children, class: classes = '', ...rest }: LucideProps
) =>
h(
'svg' as unknown as ComponentType<Partial<JSX.SVGAttributes<SVGElement> & { 'stroke-width': number | string }>>,
'svg',
{
...defaultAttributes,
width: String(size),
@@ -1,3 +1,5 @@
import type { JSX } from 'preact'
export default {
xmlns: 'http://www.w3.org/2000/svg',
width: 24,
@@ -8,4 +10,4 @@ export default {
'stroke-width': '2',
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
};
} satisfies JSX.SVGAttributes;