question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript error when assigning a responsive style to "color" attribute

See original GitHub issue

Bug 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

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. 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:closed
  • Created 3 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ljosberinncommented, Nov 2, 2020

Haha no worries, let’s say I’ve been preaching remove node_modules and lockfile a while now both in issues and on discord 😆

1reaction
aabuhijlehcommented, Nov 2, 2020

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found