tw`bg-white` at use tw variable with template string it is not work!
See original GitHub issueI get an error:
Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'StringLike'. Type 'TemplateStringsArray' is not assignable to type 'string'.
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >template strings not working [duplicate] - Stack Overflow
Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with ...
Read more >Understanding Template Literals in JavaScript - DigitalOcean
In this article, you will go over the differences between single/double-quoted strings and template literals, running through the various ways ...
Read more >Getting Literal With ES6 Template Strings - Chrome Developers
Template Strings use back-ticks (``) rather than the single or double quotes ... the addition of variables) and inside a Template Literal, ...
Read more >Documentation - Template Literal Types - TypeScript
Generating mapping types which change properties via template literal strings.
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 Free
Top 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

@KyleJune You could use the style helper which provides a stitches like API. Docs are missing but here are the tests: https://github.com/tw-in-js/twind/blob/next/packages/twind/src/tests/style.test.ts#L61
You are right that’s a mistake in the docs.
Yep. I must adjust this.
The main reason is performance. Interpolating a template string array takes some time. By accepting only a string we can boost the performance for many cases (like transforming the class name attribute).