lukeed/clsx

clsx/lite accepts ClassDictionary (TypeScript)

sndrrth opened this issue · 3 comments

The TS type of the new clxs/lite function includes the ClassDictionary type, but why? Dictionaries are not evaluated by this function, so passing them is useless. Wouldn't it be better to exclude it so that TS users are aware of that restriction?

lukeed commented

I kept it the same because you should be able to simply modify your bundler's alias config to map clsx to clsx/lite w/o changes or new errors. Also, technically, clsx/lite still accepts the non-string input values, it just doesnt do anything with them

Thanks for the explanation.

I kept it the same because you should be able to simply modify your bundler's alias config to map clsx to clsx/lite w/o changes or new errors.

That will only hide errors in runtime, no? I don't understand the reasoning 🤔