solid-primitives icon indicating copy to clipboard operation
solid-primitives copied to clipboard

combineProps type error since typescript 5.3

Open GiyoMoon opened this issue 1 year ago • 2 comments

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
image

Minimal Reproduction Link

https://github.com/GiyoMoon/solid-primitives-type-error

GiyoMoon avatar Dec 23 '23 21:12 GiyoMoon