diff --git a/types/classnames/classnames-tests.ts b/types/classnames/classnames-tests.ts index b2b8c9eba4..55b801eb40 100644 --- a/types/classnames/classnames-tests.ts +++ b/types/classnames/classnames-tests.ts @@ -38,3 +38,6 @@ const className = cx('foo', ['bar'], { baz: true }); // => "abc def xyz" // falsey values are just ignored cx(null, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1' + +// true is just ignored +cx(true || "foo"); diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts index ce2abb5ee3..40e3ce835c 100644 --- a/types/classnames/index.d.ts +++ b/types/classnames/index.d.ts @@ -9,7 +9,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | false; +type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean; interface ClassDictionary { [id: string]: boolean | undefined | null;