Skip to content

When do I need to call skipDuringClone()? #4062

Closed Answered by ekwoka
bennadel asked this question in 1. Help
Discussion options

You must be logged in to vote

Right, yeah I got it mixed up a bit.

since cloning the tree would create those elements that x-for would create, you want to prevent it from initializing x-for again and doubling the elements.

for example.

if you're only mutating a node, it likely won't cause any issues. If you're adding nodes, it might.

mutateDom basically turns off the mutation observer, does your changes, then turns it back on.

This can help ensure that you can control the flow of the initialization of the directives and trees.

So for adding, you might mutateDom( add elements) then initree. For removing, you can do mutateDom ( remove elements) and then destroyTree.

Or rather, destroyTree first?

idk. You destroy the tre…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ekwoka
Comment options

Answer selected by bennadel
@bennadel
Comment options

@ekwoka
Comment options

@bennadel
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants