aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/preact/src/clone-element.js
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/preact/src/clone-element.js')
-rw-r--r--thirdparty/preact/src/clone-element.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/thirdparty/preact/src/clone-element.js b/thirdparty/preact/src/clone-element.js
new file mode 100644
index 000000000..fc7103056
--- /dev/null
+++ b/thirdparty/preact/src/clone-element.js
@@ -0,0 +1,10 @@
+import { clone, extend } from './util';
+import { h } from './h';
+
+export function cloneElement(vnode, props) {
+ return h(
+ vnode.nodeName,
+ extend(clone(vnode.attributes), props),
+ arguments.length>2 ? [].slice.call(arguments, 2) : vnode.children
+ );
+}