We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b749948 commit 419604eCopy full SHA for 419604e
packages/classnames/classnames.tsx
@@ -11,13 +11,14 @@
11
*
12
* @param strings classNames strings
13
*/
14
-export function classnames(...strings: Array<string | undefined>) {
+export function classnames(...strings: Array<string | undefined>): string;
15
+export function classnames() {
16
let className = '';
17
const uniqueCache = new Set();
- const classNameList = strings.join(' ').split(' ');
18
+ const classNameList: string[] = [].slice.call(arguments);
19
20
for (const value of classNameList) {
- if (value === '' || uniqueCache.has(value)) {
21
+ if (value === '' || value === undefined || uniqueCache.has(value)) {
22
continue;
23
}
24
0 commit comments