Skip to content

Parameter type of classnames method #211

Answered by muhammadsammy
n2ptune asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately I don't think it would be supported because it will require generating every classnames combination which will lead to huge file size and slow autocompletion.
However you can cast the string to a compatible type:

classnames('flex fixed top-0 left-0' as TTailwindString)

but doing this will cause loss of the type safety and validation of that string.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by n2ptune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants