UNPKG

react-elegant-ui

Version:

Elegant UI components, made by BEM best practices for react

14 lines 393 B
/** * Merge react component className properties */ export var MergeReactClassnames = function (_a) { var key = _a.key, currentValue = _a.currentValue, value = _a.value, setValue = _a.setValue; if (key !== 'className') return; var newCn = [currentValue, value].filter(function (cn) { return typeof cn === 'string' && cn.length > 0; }); setValue(newCn.join(' ')); };