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
2
votes
2 answers

Is it necessary to wait for window load event before initialising a ReactJS app?

Is there any reason to wait for a window load event before initialising a react app? window.addEventListener('load', () => { ReactDOM.render(

Reactastic!

, document.getElementById('rootElement') ); }, false); As long as…
D-Money
  • 2,375
  • 13
  • 27
2
votes
1 answer

Rendering radio buttons

How do I properly define radio buttons using Maquette so the text will render? If I use a

element the text appears, but on a new line. var h = maquette.h; var dom = maquette.dom; document.addEventListener('DOMContentLoaded', function ()…

Seanny123
  • 8,776
  • 13
  • 68
  • 124
2
votes
1 answer

Location of stateful component in the VDOM after re-render

If a stateful react component C is at position P in VDOM V at time T then where will C be in VDOM V' at time T+1 after a re-render ? For example in this fiddle the state of the first stateful component is "transferred" to the second stateful…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
2
votes
1 answer

Unable to change the values of react controlled inputs

I'm trying to change values of react controlled inputs when I type in the browser. I have provided a code example. The third input is automatically filled in if the first two inputs have a value. But if they are empty how can I allow the user to…
Anurag Jain
  • 461
  • 2
  • 8
  • 21
2
votes
1 answer

DOM manipulation for Angular 2

I have a "simple" question about Angular 2 internal DOM manipulation. Is Angular 2 using Virtual DOM, Incremental DOM or what. I have been looking all over the internet to understand what Angular 2 uses for DOM manipulation internally but I can't…
coderdark
  • 1,481
  • 14
  • 30
2
votes
1 answer

ReactJS - Performance implication of `setState` in parent component

I am building a large application using React where a shared parent component handles all the state for multiple children. Some of these children render lists of over 1000 items. I realize that toggling a boolean inside the parent with setState…
jacoballenwood
  • 2,787
  • 2
  • 24
  • 39
2
votes
0 answers

Can we use Virtual DOM along with GSAP?

Currently trying to build some React components using D3 math. However, when it comes to transition/animation, kind of facing a wall. It's not straightforward. I saw folks are using libraries like GreenSock. How this affecting on Virtual DOM? Does…
shnoby
  • 53
  • 1
  • 4
2
votes
1 answer

Rendering Maquette to HTML

I want to get an HTML string representation of my Maquette view in order to prerender it to a static html file. React has ReactDOMServer.renderToString. Is there a similar method for Maquette VNodes?
Jesse Hattabaugh
  • 7,876
  • 8
  • 34
  • 38
2
votes
1 answer

React triggers onChange events for virtual DOM inputs differently than inputs in the regular DOM. Why is this?

In the virtual DOM, onChange is triggered every time the content of the input is changed. In the regular DOM, onChange is only triggered when the input element is blurred. link to GIF illustrating the behavior sample project: source code for the…
ross
  • 105
  • 8
2
votes
1 answer

Are there three tree's involved in the React Virtual Dom, or just two?

With the React virtual Dom, I understand the subtree part, or at least I think I do: React will only re-render from components that had their setState called, and potentially all children of these components. i.e. components that haven't had their…
CADBOT
  • 416
  • 2
  • 9
2
votes
1 answer

is there a way to tell react to dynamically create div if not found

New to react and I'm wondering if there is any work around to get past this error: _registerComponent(...): Target container is not a DOM element. EDIT What I'm trying to do is: I have a react function…
Nishanth Matha
  • 5,993
  • 2
  • 19
  • 28
1
vote
0 answers

React vs. Angular Component Rendering

I'm trying to understand component re-rendering in react vs. angular. My understanding is as follows: React uses Virtual DOM. This is an object in memory that models the DOM. Each time some state changes, the new object is compared to a snapshot of…
dvr
  • 370
  • 1
  • 9
1
vote
0 answers

Modify DOM outside React App without reconciliation

I have a React app embedded in an external .Net app. all works fine, but I have a plugin on the main app to translate the content of entire content including the content inside the React App which is a problem because the real Dom can't conciliate…
xzegga
  • 3,051
  • 3
  • 25
  • 45
1
vote
0 answers

What are render and commit phase exactly in React JS? And how virtual DOM helps actually?

I have read many blogs on render and commit phase in react. But couldn't understand much exactly. They mention render phase is a slow process and commit phase doesn't takes time. In simpler words, is rendering checking the current Virtual DOM with…
YASDE
  • 11
  • 3
1
vote
0 answers

What exactly do we mean by rendering in react js?

Can somebody please take away my confusion about react rendering process? when we update the state and the browser re-paint the UI of the updated component. is that what we call rendering? or when the virtual dom informs the real DOM (browser dom)…
ouakilTechie
  • 325
  • 1
  • 3
  • 8