mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 21:19:37 +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);
|
|
}
|