You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'importtype{ValidComponent}from'solid-js'constMyComponent=<TextendsValidComponent='div'>(props: DynamicProps<T>,)=>{constcombinedProps=combineProps([props])constchildren=<div>children</div>// This worked with typescript version <= 5.2 and broke in 5.3return<Dynamic{...combinedProps}>{children}</Dynamic>}exportdefaultMyComponent
Ok it has nothing to do with MaybeAccessor<PropsInput> part, the same difference is also between unknown[] and [] | unknown[], where the latter just makes the type to be inferred as a tuple.
Overwriting the children prop in combineProps rather than jsx seems to fix it.
Which is probalby a better way in general, because it doesn't cause another mergeProps to be compiled in to handle the overwritting.
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.Minimal Reproduction Link
https://github.com/GiyoMoon/solid-primitives-type-error
The text was updated successfully, but these errors were encountered: