Skip to content

Commit

Permalink
Fix type error of preact createLucideIcon() (#1754)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Fennis <[email protected]>
  • Loading branch information
nix6839 and ericfennis authored Dec 28, 2023
1 parent d9d7e24 commit e3166c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/lucide-preact/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 3 additions & 1 deletion packages/lucide-preact/src/defaultAttributes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { JSX } from 'preact'

export default {
xmlns: 'http://www.w3.org/2000/svg',
width: 24,
Expand All @@ -8,4 +10,4 @@ export default {
'stroke-width': '2',
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
};
} satisfies JSX.SVGAttributes;

0 comments on commit e3166c6

Please sign in to comment.