Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
strozw opened this issue Jan 11, 2022 · 0 comments

Comments

@strozw
Copy link
Contributor

strozw commented Jan 11, 2022

🐛 Bug Report

Overwriting Theme with xstyled 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:

  • utility props type checking allow value that not exist in theme
  • utility props type checking allow false

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant