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
-1
votes
1 answer

How ref in useRef works?

Can someone explain some React issues,? How can ref (from useRef, for example ) in component be the same if VirtualDOM creates NEW objects in every rerendering? This means that ref to that object should be differ from the previous one
Mark_Elov
  • 11
  • 2
-1
votes
2 answers

Why do we need Virtual DOM?

I read the article https://dev.to/karthikraja34/what-is-virtual-dom-and-why-is-it-faster-14p9 There is example of code, example must help us to understand answer on the question - "Why do we need virtual DOM?" From article: For example: Let's say…
Shaci
  • 316
  • 1
  • 4
  • 18
-1
votes
1 answer

ERROR TypeError: Cannot read property 'nativeElement' of undefined after modal popup loading in angular

i have a component with modal popup and defined a viewchild elementRef to try to get an element of input text after the modal popup opens. The modal is opened after click a button and there is a search button in the modal triggers a function in…
tiakham
  • 67
  • 1
  • 10
-1
votes
2 answers

I'm confused about handle re-render with React JS and Virtual DOM

I'm using React JS but I need to learn more about Virtual DOM and benefits of it. Apparently in Real DOM for each changes of UL the parent and children's should re-render ... For example consider this code:
  • List item
  • List…
John
  • 1
  • 1
-3
votes
1 answer

React. components are not rendered in the order of state change

In react, assume I have Input component with prop name = A, B, C. they are rendered in the order render() { return( ); } then I change the state of C and A in the…
PranavPinarayi
  • 3,037
  • 5
  • 21
  • 32
1 2 3
14
15