Hi, first off - thank you for maintaining this fantastic package!
That said, we've run into an issue with v2.3.0 where our bundled components are now outputting [object Object] class names because of this recent change to support a custom toString fn.
The problem only occurs after we run our code through our build pipeline which uses Rollup/Babel to produce a CJS bundle so we can render server-side.
Component Code:
const inputStyleClass = classNames(styles['text_input__input'], {
[styles['text_input__input--with-icon']]: !!icon,
});
Transpiled code:
var inputStyleClass = classnames(
styles$z['text_input__input'],
(_classNames2 = {},
_defineProperty$2(_classNames2, styles$z['text_input__input--with-icon'], !!icon),
_classNames2,
)
);
We've locked our components to 2.2.6 to resolve the issue and suggest the following change:
if ((/\{\s*\[native code\]\s*\}/).test(arg.toString)) {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
} else {
classes.push(arg.toString());
}
Hi, first off - thank you for maintaining this fantastic package!
That said, we've run into an issue with v
2.3.0where our bundled components are now outputting[object Object]class names because of this recent change to support a customtoStringfn.The problem only occurs after we run our code through our build pipeline which uses Rollup/Babel to produce a CJS bundle so we can render server-side.
Component Code:
Transpiled code:
We've locked our components to
2.2.6to resolve the issue and suggest the following change: