From 126f06913823e0f18844d904d7ce2c1a4b986185 Mon Sep 17 00:00:00 2001 From: Donny Verduijn Date: Sat, 12 Oct 2024 19:13:49 +0200 Subject: [PATCH] add deferred type resolution to PropsOf type alias --- .../core/src/core/factory/create-polymorphic-component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/@mantine/core/src/core/factory/create-polymorphic-component.ts b/packages/@mantine/core/src/core/factory/create-polymorphic-component.ts index 5bc066e5775..5ba48e1e9c1 100644 --- a/packages/@mantine/core/src/core/factory/create-polymorphic-component.ts +++ b/packages/@mantine/core/src/core/factory/create-polymorphic-component.ts @@ -3,10 +3,9 @@ type ExtendedProps = OverrideProps & type ElementType = keyof JSX.IntrinsicElements | React.JSXElementConstructor; -type PropsOf = JSX.LibraryManagedAttributes< - C, - React.ComponentPropsWithoutRef ->; +type PropsOf = C extends ElementType + ? JSX.LibraryManagedAttributes> + : never; type ComponentProp = { component?: C;