clsx/lite accepts ClassDictionary (TypeScript)
sndrrth opened ·
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?
- LU
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
- SN
Thanks for the explanation.
- SK
> 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 🤔
droid51referenced this in Lite Version: Improve Typescript Definition and Support for "moduleResolution": "Node" #942 years ago on GitHub