cloneValidElement
Type-safe clone element
API
function cloneValidElement<Props>(element: ReactElement<Props> | ReactNode, props?: Partial<Props> & Attributes, ...children: ReactNode[]): ReactElement<Props> | ReactNode;
Usage
import { cloneValidElement } from '@feedzai/js-utilities';
const clonedElement = cloneValidElement(
<Row title="Cabbage">
Hello
</Row>,
{ isHighlighted: true },
'Goodbye'
);