<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>what is virtual dom in react - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/what-is-virtual-dom-in-react/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-virtual-dom-in-react/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 04 May 2022 07:23:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>what is virtual dom in react - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-virtual-dom-in-react/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is React DOM ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-dom/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-dom/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 24 Mar 2022 12:30:23 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[advantages of virtual dom in react]]></category>
		<category><![CDATA[finddomnode]]></category>
		<category><![CDATA[import react dom]]></category>
		<category><![CDATA[react dom full form]]></category>
		<category><![CDATA[react dom install]]></category>
		<category><![CDATA[react dom npm]]></category>
		<category><![CDATA[react router dom]]></category>
		<category><![CDATA[react vs reactdom]]></category>
		<category><![CDATA[reactdom]]></category>
		<category><![CDATA[rendering elements]]></category>
		<category><![CDATA[virtual dom]]></category>
		<category><![CDATA[virtual dom in react]]></category>
		<category><![CDATA[what is dom in react native]]></category>
		<category><![CDATA[what is react dom]]></category>
		<category><![CDATA[what is react dom server]]></category>
		<category><![CDATA[what is react router dom]]></category>
		<category><![CDATA[what is real dom in react js]]></category>
		<category><![CDATA[what is the difference between react-router and react-router-dom]]></category>
		<category><![CDATA[what is virtual dom in react]]></category>
		<category><![CDATA[what is virtual dom in react native]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3994</guid>

					<description><![CDATA[It is an object which exposes a number of top level APIs to interact with the browser DOM. It provides DOM-specific methods that can be used at the top level of a web app to enable an efficient way of managing DOM elements of the web page. Most of your components should not need to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4281 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom.jpg" alt="" width="1291" height="663" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom.jpg 1291w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-300x154.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-1024x526.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-768x394.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-390x200.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-820x421.jpg 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-virtual-dom-1180x606.jpg 1180w" sizes="(max-width: 1291px) 100vw, 1291px" /></p>
<ul>
<li style="text-align: justify;">It is an object which exposes a number of top level APIs to interact with the browser DOM.</li>
<li style="text-align: justify;">It provides DOM-specific methods that can be used at the top level of a web app to enable an efficient way of managing DOM elements of the web page.</li>
<li style="text-align: justify;">Most of your components should not need to use this module.</li>
<li style="text-align: justify;">It consists of following methods:
<ul>
<li style="text-align: justify;">render ()</li>
<li style="text-align: justify;">findDOMNode ()</li>
<li style="text-align: justify;">unmountComponentAtNode ()</li>
<li style="text-align: justify;">create Portal ()</li>
<li style="text-align: justify;">hydrate ()</li>
</ul>
</li>
</ul>
<p><img decoding="async" class="alignnone size-full wp-image-4062" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom.png" alt="" width="795" height="341" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom.png 795w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-300x129.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-768x329.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-390x167.png 390w" sizes="(max-width: 795px) 100vw, 795px" /></p>
<h4 id="render" style="text-align: justify;"><strong>render ()</strong></h4>
<ul style="text-align: justify;">
<li>It is used to render a single React Component or several Components wrapped together in a Component or a div element.</li>
<li>In ReactDom it is one of the most important methods.</li>
<li>This function uses the efficient methods of React for updating the DOM by being able to change only a subtree, efficient diff methods, etc.</li>
<li>Element, Container, Callback are three parameters used in this method.</li>
</ul>
<p style="text-align: justify;"><strong>Syntax</strong>:</p>
<p style="text-align: justify;"><img decoding="async" class="aligncenter wp-image-3997 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/render-syntax.png" alt="" width="723" height="100" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/render-syntax.png 723w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/render-syntax-300x41.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/render-syntax-390x54.png 390w" sizes="(max-width: 723px) 100vw, 723px" /></p>
<h4 id=""><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4282 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom.jpg" alt="" width="1160" height="654" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom.jpg 1160w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-300x169.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-1024x577.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-768x433.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-390x220.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-dom-820x462.jpg 820w" sizes="(max-width: 1160px) 100vw, 1160px" /></h4>
<h4 id="finddomnode" style="text-align: justify;">findDOMNode ()</h4>
<ul style="text-align: justify;">
<li>It is used to get the DOM node where a particular React component was rendered.</li>
<li>The following method can be done by adding a <strong>ref</strong> attribute to each component itself and it is used rarely in ReactDOM.</li>
<li>It is also useful for reading values out of the DOM, such as form field values and performing DOM measurements.</li>
<li>A single parameter component that expects a React Component to be searched in the Browser DOM.</li>
</ul>
<p><strong>Syntax</strong>:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3999 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/finddomnode-syntax.png" alt="" width="761" height="109" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/finddomnode-syntax.png 761w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/finddomnode-syntax-300x43.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/finddomnode-syntax-390x56.png 390w" sizes="(max-width: 761px) 100vw, 761px" /></p>
<h4 id="unmountcomponentatnode" style="text-align: justify;"><strong>unmountComponentAtNode ()</strong></h4>
<ul style="text-align: justify;">
<li>It is used to unmount or remove the React Component that was rendered to a particular container.</li>
<li>It is better to remove the component, making the web page more efficient.</li>
<li>A single parameter container which expects the DOM container from which the React component has to be removed.</li>
</ul>
<p style="text-align: justify;"><strong>Syntax</strong>:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3998 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/unmountComponentNode-syntax.png" alt="" width="756" height="107" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/unmountComponentNode-syntax.png 756w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/unmountComponentNode-syntax-300x42.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/unmountComponentNode-syntax-390x55.png 390w" sizes="(max-width: 756px) 100vw, 756px" /></p>
<h4 id="create-portal" style="text-align: justify;"><strong>create Portal ()</strong></h4>
<ul style="text-align: justify;">
<li>It is used to create a portal and provide a way to render children into a DOM node that exists outside the hierarchy of the DOM component.</li>
<li>It allows us to render a component into a DOM node that resides outside the current DOM hierarchy of the parent component.</li>
<li>Child, Container are the two parameters used in this method.</li>
</ul>
<p style="text-align: justify;"><strong>Syntax</strong>:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3995 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax.png" alt="" width="860" height="136" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax.png 860w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax-300x47.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax-768x121.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax-390x62.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/find-dom-node-syntax-820x130.png 820w" sizes="(max-width: 860px) 100vw, 860px" /></p>
<h4 id="hydrate" style="text-align: justify;">hydrate ()</h4>
<ul style="text-align: justify;">
<li>It is equivalent to the render () method, but is implemented while using server-side rendering.</li>
<li>Element, Container, Callback are the three parameters used in this method.</li>
</ul>
<p style="text-align: justify;"><strong>Syntax</strong>:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3996 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax.png" alt="" width="866" height="144" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax.png 866w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax-300x50.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax-768x128.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax-390x65.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/hydrate-syntax-820x136.png 820w" sizes="(max-width: 866px) 100vw, 866px" /></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-dom/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is virtual DOM ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-virtual-dom/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-virtual-dom/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Tue, 22 Mar 2022 06:51:48 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[advantages of virtual dom in react]]></category>
		<category><![CDATA[react virtual dom]]></category>
		<category><![CDATA[virtual dom]]></category>
		<category><![CDATA[virtual dom example]]></category>
		<category><![CDATA[virtual dom full form]]></category>
		<category><![CDATA[virtual dom in react]]></category>
		<category><![CDATA[virtual dom in react js]]></category>
		<category><![CDATA[virtual dom react]]></category>
		<category><![CDATA[virtual dom vs real dom]]></category>
		<category><![CDATA[virtual dom vs real dom in react]]></category>
		<category><![CDATA[what is dom in react]]></category>
		<category><![CDATA[what is real dom]]></category>
		<category><![CDATA[what is virtual dom in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3969</guid>

					<description><![CDATA[It is a lightweight JS object which is an in-memory representation of real DOM. It is a programming concept where an ideal, or “virtual”, representation of a UI is kept in memory and synced with the “real” DOM by a library such as ReactDOM. Virtual DOM has the same properties as that of the Real DOM, however [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">It is a lightweight JS object which is an in-memory representation of real DOM.</li>
<li style="text-align: justify;">It is a programming concept where an ideal, or “virtual”, representation of a UI is kept in memory and synced with the “real” DOM by a library such as ReactDOM.</li>
<li style="text-align: justify;"><a href="https://www.wikitechy.com/tutorials/react/reactjs-dom-vs-virtual-dom">Virtual DOM</a> has the same properties as that of the Real DOM, however it lacks the power to directly change the content of the screen.</li>
<li style="text-align: justify;">It is also considered as a part of “virtual DOM” implementation in React.</li>
<li style="text-align: justify;">Although the concept has been around for several years, it was made more popular by its use in the React framework.</li>
<li style="text-align: justify;">It is Created by “<strong>Richie Harris</strong>”.</li>
</ul>
<h4 id="why-do-we-need-a-virtual-dom">Why do we need a virtual DOM ?</h4>
<ul>
<li>In our client-side application has a super complex structure, which will result in a complicated DOM tree.</li>
<li>Manipulating DOM at once can without problems result in overall performance.</li>
</ul>
<p>For example, let’s take this simple HTML document with an unordered list one list item.</p>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">&lt;!doctype html&gt;<br/>&lt;html lang=&quot;en&quot;&gt;<br/> &lt;head&gt;&lt;/head&gt;<br/><br/> &lt;body&gt;<br/>    &lt;ul class=&quot;list&quot;&gt;<br/>        &lt;li class=&quot;list__item&quot;&gt;List item&lt;/li&gt;<br/>    &lt;/ul&gt;<br/>  &lt;/body&gt;<br/>&lt;/html&gt;</code></pre> </div>
<p>This document can be represented as the following DOM tree.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-4043 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-virtual-dom-1.png" alt="" width="561" height="321" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-virtual-dom-1.png 561w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-virtual-dom-1-300x172.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-virtual-dom-1-390x223.png 390w" sizes="(max-width: 561px) 100vw, 561px" /></p>
<p>We need to adjust the content of the first list item to &#8220;List item one&#8221; and also add a 2nd listing object. we will need use the DOM APIs to find the elements we need to replace, create the new elements, upload attributes and content, then finally replace the DOM elements themselves.</p>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">const listItemOne = document.getElementsByClassName(&quot;list__item&quot;)[0];<br/>listItemOne.textContent = &quot;List item one&quot;;<br/><br/>const list = document.getElementsByClassName(&quot;list&quot;)[0];<br/>const listItemTwo = document.createElement(&quot;li&quot;);<br/>listItemTwo.classList.add(&quot;list__item&quot;);<br/>listItemTwo.textContent = &quot;List item two&quot;;<br/>list.appendChild(listItemTwo);</code></pre> </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-virtual-dom/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
