solid-primitives
solid-primitives copied to clipboard
combineProps type error since typescript 5.3
Describe the bug
I noticed that combineProps
throws a type error when upgrading to typescript 5.3. In typescript <=5.2, the same code worked without issues.
import { combineProps } from '@solid-primitives/props'
import { Dynamic, DynamicProps } from 'solid-js/web'
import type { ValidComponent } from 'solid-js'
const MyComponent = <T extends ValidComponent = 'div'>(
props: DynamicProps<T>,
) => {
const combinedProps = combineProps([props])
const children = <div>children</div>
// This worked with typescript version <= 5.2 and broke in 5.3
return <Dynamic {...combinedProps}>{children}</Dynamic>
}
export default MyComponent
Minimal Reproduction Link
https://github.com/GiyoMoon/solid-primitives-type-error