mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +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);
|
|
}
|