Is this a re-rendering bug? #11419
leizha
started this conversation in
General Discussions
Replies: 1 comment
-
This is not a bug. Vue uses a virtual DOM. in order to diff the old list and the new list and decide which DOM elements to re-use and which to update, vnodes have to be created for all items in the list. But Vue will only change the minimum amount of DOM nodes necessary. This can have an impact on performance in very large lists, yes. That's generally one of the downsides of virtual DOM implementations used by Vue or React. It will perform better in upcomin Vapor mode. |
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
-
I created a simple test in the playground. It creates 4 buttons.
Clicking any button removes it from the list. Note that I added console.log so I know when it renders. Here is the tricky part:
Apparently removing an element from the middle of the array triggers re-render of all the subsequent elements. Is this expected? This can be a performance hit when the array is very large.
Beta Was this translation helpful? Give feedback.
All reactions