Questions tagged [virtual-dom]

Use virtual-dom for questions related to an object model which mimics the structure of and intercepts events normally handled by the real document object model (DOM).

The virtual-dom applies of the technique of double buffering to the DOM. It is used for many purposes, including:

  • security: sandboxing DOM mutation
  • performance: minimization of repaints and reflows
  • testing: performing static analysis on the rendered tree

References

215 questions
394
votes
6 answers

Why is React's concept of Virtual DOM said to be more performant than dirty model checking?

I saw a React dev talk at (Pete Hunt: React: Rethinking best practices -- JSConf EU 2013) and the speaker mentioned that dirty-checking of the model can be slow. But isn't calculating the diff between virtual DOMs actually even less performant…
Daniil
  • 5,760
  • 5
  • 18
  • 29
94
votes
2 answers

Is Shadow DOM fast like Virtual DOM in React.js?

Does implementing Shadow DOM in my projects will make them faster like virtual DOM that's used by React?
Hmoo_oomH
  • 1,045
  • 1
  • 9
  • 9
60
votes
4 answers

Does React Native have a 'Virtual DOM'?

From ReactJS wiki page about Virtual DOM: React creates an in-memory data structure cache, computes the resulting differences, and then updates the browser's displayed DOM efficiently. This allows the programmer to write code as if the entire…
oleh.meleshko
  • 4,675
  • 2
  • 27
  • 40
48
votes
3 answers

Does Angular 2 use Shadow DOM or a Virtual DOM?

What does Angular 2 use to update the DOM. Is it Shadow DOM or Virtual DOM ? Was there any such concept in Angular 1?
Shivanka
  • 723
  • 2
  • 8
  • 21
20
votes
1 answer

How is React's Virtual DOM faster than DOM?

I understand that React creates a virtual DOM and compares the difference and then just updated the actual element of the real DOM but how is that more efficient if I change it manually? Via getElementById or by using the jQuery function?
Yahoo
  • 4,093
  • 17
  • 59
  • 85
20
votes
1 answer

Why can't browsers use a virtual dom internally as an optimisation?

There are lots of SO questions and blogs on the internet attempting to explain what virtual dom is, but this question is about why this kind of optimisation has to be to implemented in JavaScript/as part of a framework, rather than by the browser…
dan-man
  • 2,949
  • 2
  • 25
  • 44
19
votes
3 answers

Vue.js - updated array item value doesn't update in page

"test" is an array of object in my vue data var vue = new Vue({ el: '#content', data: { test: [ { array: [0, 0, 0, 0] }, { array: [0, 0, 0, 0] } ], number: 0 }, methods: { …
Razinar
  • 727
  • 3
  • 13
  • 21
12
votes
2 answers

Angular 5.0 change detection strategy VS React's change detection strategy

I understood how change detection works in Angular 5.0. Can some one help me to understand how the same works in React and how much it was different from Angular's ?
kalki
  • 465
  • 7
  • 14
9
votes
2 answers

React JS Freezes Browser

I have a React component which has 2000 elements and based on some filter conditions I update my state, which internally causes re-rendering. Everything seems to be working fine. But when I togglefilter from 2000 elements to say 1000 elements and…
Hari
  • 383
  • 1
  • 3
  • 9
8
votes
1 answer

How to detect rerenders in React JS correctly?

Let's say we have a parent component and multiple functional child components. I want to clearly know if the parent re-renders does the child re-renders or not. After going through a few articles I came to know there are 3 ways we can detect…
Deepak Kumar Padhy
  • 4,128
  • 6
  • 43
  • 79
7
votes
0 answers

How to integrate Vue/NuxtJs with Ezoic?

Ezoic provides web publishers with automated website intelligence for their ads, content, layouts, and more. Ezoic can by only integrated by Cloudflare or name servers -…
7
votes
2 answers

Does Angular have the equivalent of React's Virtual DOM?

It is not advised to use Bootstrap directly with React because Bootstrap's JavaScript may alter the DOM directly, interfering with React's Virtual DOM system. Can one say the same about Angular (2+)?
Sammy
  • 3,395
  • 7
  • 49
  • 95
6
votes
2 answers

How does react update part of the DOM?

I know that this subject has been discussed a lot obviously, but I'm not sure how to research my question that is rather specific and I hope it follows the rules here. I know that to decide whether to update the DOM or not, react compares the…
sir-haver
  • 3,096
  • 7
  • 41
  • 85
6
votes
1 answer

React click event bubbling "sideways", not just "up"

I have nested click event handlers within a component: class ListItem extends React.Component { ... render() { return (
...Content...
mgalgs
  • 15,671
  • 11
  • 61
  • 74
5
votes
4 answers

Prevent my Elm app from crashing when a 3rd party changes the DOM

I have an Elm app. A while ago I realized that my app was crashing locally when I used FontAwesome icons. I came to understand that it happened because I chose SVG icons and therefore FontAwesome was modifying the DOM. That conflicted with Elm's…
viam0Zah
  • 25,949
  • 8
  • 77
  • 100
1
2 3
14 15