mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +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);
|
|
}
|