How to use the classnames/dedupe.apply function in classnames

To help you get started, we’ve selected a few classnames examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github collingo / react-transition-manager / src / clone-with-classes.js View on Github external
export default function cloneWithClasses(element, state) {
  let currentClasses = element.props.className ? element.props.className.split(' ') : [];
  let newClasses = classnames.apply(null, currentClasses.concat(getClasses(state)));
  const newElement = React.cloneElement(element, {
    className: newClasses,
    transitionState: state
  });
  return newElement;
}

classnames

A simple utility for conditionally joining classNames together

MIT
Latest version published 11 months ago

Package Health Score

88 / 100
Full package analysis