lukeed/clsxPublic

A tiny (239B) utility for constructing `className` strings conditionally.

"This expression is not callable." error when using TypeScript with moduleResolution "node16" or "nodenext"

WO

When using TypeScript with moduleResolution "node16" or "nodenext", importing clsx and using it:

```ts import clsx from 'clsx';

clsx('a', 'b', 'c'); ```

produces the following error:

``` src/index.tsx(3,0): error TS2349: This expression is not callable. Type 'typeof import("/node_modules/clsx/clsx")' has no call signatures. ```

It appears the problem is with the way typings are shipped with this library. Please read: https://github.com/microsoft/TypeScript/issues/49189#issuecomment-1137756847

The thread also mentions the same problem with classnames package, but it appears that they have dealt with it since then.

  1. WO
    Author

    Would have been fixed by #57

  2. LU

    Closed by #57

  3. lukeedclosed3 years ago on GitHub