import React from 'react'; import cx from 'classnames'; export const getRenderChildWithClassName = (className: string) => (child: any) => { if (child === null || child === '') { return null; } const { props } = child; if (!props) { return
{child}
; } return React.cloneElement(child, { ...props, className: cx(className, props.className), }); };