Closed yamitzky closed 2 years ago
This issue can be fixed by reverting https://github.com/gregberge/xstyled/pull/310
@probablyup maybe you could help on this, this bug is introduced by your PR. But I could take a deeper look when I have a moment.
Will attempt to fix, thanks!
@yamitzky this should do the trick https://github.com/gregberge/xstyled/pull/319/files
🐛 Bug Report
With xstyled@3.1.0 and emotion, SystemProps does not infer correctly.
For example,
py={4}
makes TypeScript errorType '4' is not assignable to type 'SystemProp<PaddingTop<0 | (string & {})> & PaddingBottom<0 | (string & {})>, Theme> | undefined'
with creating a d.ts file.Without custom d.ts,
pt={y}
is valid, but wrong utilities are also valid such asopacity={{ xxx: 'typo' }}
.To Reproduce
<x.div py={4}>
yarn tsc --noEmit
Expected behavior
With/without d.ts,
<x.div mt={4}>
must not be type error<x.div opacity={{ hov: 'typo' }}>
must be type errorLink to repl or repo (highly encouraged)
prepared two examples to reproduce.
Run
npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard
Paste the results here: