diff --git a/packages/lucide-preact/src/createLucideIcon.ts b/packages/lucide-preact/src/createLucideIcon.ts index 75bfaf8c7..8101577d4 100644 --- a/packages/lucide-preact/src/createLucideIcon.ts +++ b/packages/lucide-preact/src/createLucideIcon.ts @@ -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 & { 'stroke-width': number | string }>>, + 'svg', { ...defaultAttributes, width: String(size), diff --git a/packages/lucide-preact/src/defaultAttributes.ts b/packages/lucide-preact/src/defaultAttributes.ts index 19adbfc38..9f1b78dbf 100644 --- a/packages/lucide-preact/src/defaultAttributes.ts +++ b/packages/lucide-preact/src/defaultAttributes.ts @@ -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;