Replies: 1 comment
-
By default The easiest way around this would be to make a new node, and then copy the contents of the old one with a custom resolving function. For example, to deeply-clone the Node: const resolve = (source) => {
if (source instanceof Node) {
return document.createNode().copy(source, resolve);
}
return source;
};
const clonedNode = document.createNode().copy(originalNode, resolve); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey hello !
I'm trying to understand the reason why a : " Node cannot be copied ".
Trying to read sources and understand but completely lost in there, but basically, what would prevent a clone() on a node ?
Beta Was this translation helpful? Give feedback.
All reactions