Skip to content

Commit 696553f

Browse files
committed
fix(css): return undefined if there is no className
1 parent da560d5 commit 696553f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-styles/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* @param {any} args list of objects, string, or arrays to reduce
44
*/
5-
export function css(...args: any): string {
6-
// Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
5+
export function css(...args: any): string | undefined {
6+
// Adapted from https://github.com/JedWatson/classnames/blob/main/index.js
77
const classes = [] as string[];
88
const hasOwn = {}.hasOwnProperty;
99

@@ -26,5 +26,5 @@ export function css(...args: any): string {
2626
}
2727
});
2828

29-
return classes.join(' ');
29+
return classes.join(' ') || undefined;
3030
}

0 commit comments

Comments
 (0)