Closed sunshixiong789 closed 4 years ago
@sunshixiong789 Please provide a full reproduction test case. This would help a lot π· . A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!
https://codesandbox.io/embed/create-react-app-with-typescript-i5sp7
I used the demo, can't find error. but use IDE, throw the typescript error
I can reproduce it in the codesandbox (you have to force it to evaluate the expression).
Can't confirm if it's an actual bug though.
I use the typescript3.5.2, it's a right,but I use the typescript3.6.3. throw the
Error:(24, 3) TS2345: Argument of type 'StyleFunction<Partial<Record<"border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop", any>> & Partial<Record<"display" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "displayPrint", any>> & ... 6 more ... & Partial<...>>' is not assignable to parameter of type 'CreateCSSProperties
This sandbox seems to have the same issue: https://codesandbox.io/s/k10p4yj8zr. This only happens when methods are used to interpolate a value. It looks like a method is not an accepted type which include 'string | number | CSSProperties | JSSFontface | JSSFontface[] | undefined'.
It's not the same problem,you shoud use createStyles
I find the error
https://codesandbox.io/s/create-react-app-with-typescript-02vx8
I have updated the issue description. The problem seems reproducible with the latest version.
I can't reproduce with the latest version (v5.0.0-alpha.13): https://codesandbox.io/s/create-react-app-with-typescript-forked-h8z1s?file=/src/Box.tsx.
Current Behavior π―
Expected Behavior π€
No errors
Steps to Reproduce πΉ
https://codesandbox.io/s/create-react-app-with-typescript-02vx8
Context π¦
Your Environment π