mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 04:00:33 +08:00
the original classname() accepts boolean, as well as falsy values
This commit is contained in:
@@ -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");
|
||||
|
||||
2
types/classnames/index.d.ts
vendored
2
types/classnames/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user