Merge pull request #25755 from gfx/classnames/accept-boolean

classnames: let classNames() to accept boolean, as the original implementation does
This commit is contained in:
Daniel Rosenwasser
2018-05-31 21:59:15 -07:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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");
+1 -1
View File
@@ -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;