mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-11 10:05:07 +08:00
9 lines
275 B
TypeScript
9 lines
275 B
TypeScript
import * as React from 'react';
|
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
|
|
if (!React.isValidElement(element)) return element;
|
|
|
|
return React.cloneElement(element, ...restArgs);
|
|
}
|