Typescript error when using utils with array input prop
See original GitHub issueBug report
Describe the bug
When using an util in the stitches config that has an input prop of type:
value: [Stitches.ScaleValue<"colors">, number])
there is a typescript error when trying to use that util e.g.
colorUtil: ["$red", 0.5]
the error is Type ‘string’ is not assignable to type ‘ScaleValue<“colors”>’ on the $red part, The really weird thing is that autocompletes works correctly and offers the correct $red option.
To Reproduce
Here is a code sandbox reproducing the error, wait for the sandbox to be fully loaded and the error will appear on line 13 https://codesandbox.io/s/late-glade-9wxlt?file=/src/App.tsx:238-262 This is a fork of the base stitches code sandbox I found online. I upgraded dependencies to latest typescript and stitches
Expected behavior
No typescript error
Screenshots
System information
- OS: macOs
- Version of Stitches: 1.0.0
- Version of Node.js: 14
Additional context
It looks like the typescript version doesn’t change the result.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Btw, it also won’t work with PropertyValue.
Same issue here but with objects,
error looks like this,
no suggestions either but works.