TypeScript error when assigning a responsive style to "color" attribute
See original GitHub issueBug report
Describe the bug
I’m getting this typescript error
Type 'string[]' is not assignable to type 'string | (string & (string | number | symbol | null)[]) | (string & { [x: string]: string | number | symbol | undefined; [x: number]: string | number | symbol | undefined; }) | undefined'.
when assigning an array to “color” attribute
<Flex color={["white", "white", "primary.700", "primary.700"]}></Flex>
To reproduce
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Minimal reproduction
Expected behavior
Screenshots
System information
- OS: macOS
- Browser (if applies): Chrome
- Version of @chakra-ui/core: 0.8.0
- Version of Node.js: 12.5.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Type {} is not assignable to type CSSProperties error
The problem is the type-checking, and you actually cannot assign a falsy value to the borderBottom property, which expects a string instead.
Read more >15 Typescript Mistakes To Avoid - SoftwareMill Tech Blog
Above code will fail with: Argument of type 'String' is not assignable to parameter of type 'string'. 'string' is a primitive, but 'String'...
Read more ><color> - CSS: Cascading Style Sheets - MDN Web Docs
The currentcolor keyword represents the value of an element's color property. This lets you use the color value on properties that do not ......
Read more >A Complete Guide to Custom Properties | CSS-Tricks
Let's imagine you're using a color function, say rgba() . Each color channel value in there can be its own custom property.
Read more >CSS Variables - The var() function - W3Schools
A good way to use CSS variables is when it comes to the colors of your design. ... of defining some colors in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haha no worries, let’s say I’ve been preaching
remove node_modules and lockfile
a while now both in issues and on discord 😆And you it looks like you told me to remove the lock file in an earlier comment but I didn’t pay enough attention and just removed node_modules. Sorry for the trouble 😃