styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.27k stars 107 forks source link

Overriding `Theme` causes a type error occurred in specify a value that not exist in theme into utility props #344

Open strozw opened 2 years ago

strozw commented 2 years ago

🐛 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

  1. Overwrite Theme by referring to the document Use xstyled with TypeScript.
  2. specify a value that not exist in theme into utility props (example: <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:

Link to repl or repo (highly encouraged)

Run 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