Open strozw opened 2 years ago
Overwriting Theme withxstyled v3.1 or later will cause a type error if you specify a value that does not exist in theme into utility props.
Theme
xstyled v3.1
Use xstyled with TypeScript
<x.div w={123} />
<x.div w={false}>
If expect the same behavior as with v3.0, it should work like this:
v3.0
false
@xstyled/styled-components v3.5.1
@xstyled/styled-components v3.0.3
npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard
Paste the results here:
## System: - OS: macOS 12.1 - CPU: (10) arm64 Apple M1 Max - Memory: 33.10 GB / 64.00 GB - Shell: 5.8 - /opt/homebrew/bin/zsh ## Binaries: - Node: 16.13.0 - ~/.asdf/installs/nodejs/16.13.0/bin/node - Yarn: 1.22.17 - /opt/homebrew/bin/yarn - npm: 8.1.0 - ~/.asdf/plugins/nodejs/shims/npm ## npmPackages: - styled-components: ^5.3.0 => 5.3.3
🐛 Bug Report
Overwriting
Theme
withxstyled v3.1
or later will cause a type error if you specify a value that does not exist in theme into utility props.To Reproduce
Theme
by referring to the documentUse xstyled with TypeScript
.<x.div w={123} />
or<x.div w={false}>
Expected behavior
If expect the same behavior as with
v3.0
, it should work like this:false
Link to repl or repo (highly encouraged)
@xstyled/styled-components v3.5.1
& overrideTheme
https://codesandbox.io/s/red-dust-96qy1
@xstyled/styled-components v3.5.1
& not overrideTheme
https://codesandbox.io/s/great-darwin-m4b64@xstyled/styled-components v3.0.3
& overrideTheme
https://codesandbox.io/s/blissful-pond-o7hnnRun
npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard
Paste the results here: