mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
8 lines
218 B
TypeScript
8 lines
218 B
TypeScript
import * as React from 'react';
|
|
|
|
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
|
|
if (!React.isValidElement(element)) return element;
|
|
|
|
return React.cloneElement(element, ...restArgs);
|
|
}
|