fix(lucide-preact): handle className prop (#3751)

This commit is contained in:
ocavue
2025-11-07 20:07:57 +11:00
committed by GitHub
parent 190e8372af
commit 2c46ea9948

View File

@@ -10,7 +10,7 @@ import type { IconNode, LucideIcon, LucideProps } from './types';
* @returns {FunctionComponent} LucideIcon * @returns {FunctionComponent} LucideIcon
*/ */
const createLucideIcon = (iconName: string, iconNode: IconNode): LucideIcon => { const createLucideIcon = (iconName: string, iconNode: IconNode): LucideIcon => {
const Component = ({ class: classes = '', children, ...props }: LucideProps) => const Component = ({ class: classes = '', className = '', children, ...props }: LucideProps) =>
h( h(
Icon, Icon,
{ {
@@ -20,6 +20,7 @@ const createLucideIcon = (iconName: string, iconNode: IconNode): LucideIcon => {
`lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${toKebabCase(toPascalCase(iconName))}`,
`lucide-${toKebabCase(iconName)}`, `lucide-${toKebabCase(iconName)}`,
classes, classes,
className,
), ),
}, },
children, children,