2019-04-24 12:21:02 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
|
|
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
|
|
|
|
if (!React.isValidElement(element)) return element;
|
|
|
|
|
|
|
|
return React.cloneElement(element, ...restArgs);
|
2019-05-07 14:57:32 +08:00
|
|
|
}
|