<?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>ReactJS - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/category/reactjs/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/category/reactjs/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 04 May 2022 07:57:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>ReactJS - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/category/reactjs/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What are the three principles that Redux follows ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-three-principles-that-redux-follows/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-three-principles-that-redux-follows/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 28 Mar 2022 06:53:26 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[a store is an object tree in redux]]></category>
		<category><![CDATA[changes are initiated through actions in redux]]></category>
		<category><![CDATA[Fundamental Principles of Redux]]></category>
		<category><![CDATA[list down the components of redux]]></category>
		<category><![CDATA[reducer in redux]]></category>
		<category><![CDATA[reducers are a pure function in redux]]></category>
		<category><![CDATA[redux concept]]></category>
		<category><![CDATA[Redux Core Principles Explained]]></category>
		<category><![CDATA[the following statements are true about redux except]]></category>
		<category><![CDATA[what are the key principles of redux]]></category>
		<category><![CDATA[What are the three principles that Redux follows]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4017</guid>

					<description><![CDATA[Redux is one of the most trending libraries for front-end development in today’s marketplace. There are three principles in redux: Single source of truth State is read-only Changes are made with pure functions Single source of truth: The entire application is stored in an object/ state tree within a single store. It debugs or inspects the application [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4263 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux.png" alt="" width="859" height="528" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux.png 859w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux-300x184.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux-768x472.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux-390x240.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-redux-820x504.png 820w" sizes="(max-width: 859px) 100vw, 859px" /></p>
<ul>
<li>Redux is one of the most trending libraries for front-end development in today’s marketplace.</li>
<li>There are three principles in redux:
<ul>
<li><strong>Single source of truth</strong></li>
<li><strong><em>State is read-only</em></strong></li>
<li><strong>Changes are made with pure functions</strong></li>
</ul>
</li>
</ul>
<p><img decoding="async" class="alignnone size-full wp-image-4057" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle.png" alt="" width="919" height="492" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle.png 919w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle-300x161.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle-768x411.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle-390x209.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-core-principle-820x439.png 820w" sizes="(max-width: 919px) 100vw, 919px" /></p>
<p><strong>Single source of truth:</strong></p>
<ul>
<li>The entire application is stored in an object/ state tree within a single store.</li>
<li>It debugs or inspects the application and easier to keep track of changes over time.</li>
<li>It has been traditionally difficult to implement &#8211; Undo/Redo.</li>
<li>If all of your states is stored in a single tree, it can be suddenly trivial to implement.</li>
</ul>
<p><em><strong>For</strong></em><em> <strong>example,</strong></em></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">console.log(store.getState())<br/><br/>/* Prints<br/>{<br/>  visibilityFilter: &#039;SHOW_ALL&#039;,<br/>  todos: [<br/>    {<br/>      text: &#039;Consider using Redux&#039;,<br/>      completed: true,<br/>    },<br/>    {<br/>      text: &#039;Keep all state in a single tree&#039;,<br/>      completed: false<br/>    }<br/>  ]<br/>}<br/>*/</code></pre> </div>
<p><img decoding="async" class="alignnone size-full wp-image-4265 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-data-flow.jpg" alt="" width="642" height="472" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-data-flow.jpg 642w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-data-flow-300x221.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-data-flow-390x287.jpg 390w" sizes="(max-width: 642px) 100vw, 642px" /></p>
<p><strong>State is read-only:</strong></p>
<ul>
<li style="text-align: justify;">The only way to change the state is to emit an action, an object describing what happened.</li>
<li style="text-align: justify;">It ensures that neither the views nor the network callbacks will ever write directly to the state.</li>
<li style="text-align: justify;">All changes are centralized and happen one by one in a strict order, there are no subtle race conditions to watch out for.</li>
<li style="text-align: justify;">The minimal representation of data is just like state, the action is the minimal representation of the change to that data.</li>
</ul>
<p><strong>For</strong> <strong>example,</strong></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">store.dispatch({<br/>  type: &#039;COMPLETE_TODO&#039;,<br/>  index: 1<br/>})<br/><br/>store.dispatch({<br/>  type: &#039;SET_VISIBILITY_FILTER&#039;,<br/>  filter: &#039;SHOW_COMPLETED&#039;<br/>})</code></pre> </div>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4266" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/redux-data-flow-diagram.gif" alt="" width="800" height="700" /></p>
<p><strong>Changes are made with pure functions:</strong></p>
<ul>
<li>To specify how the state tree is transformed by actions, you write pure reducers<strong>.</strong></li>
<li>Pure functions are those whose return value depends solely on the values of their arguments.</li>
<li>Reducers are just functions, you can control the order in which they are called, pass additional data, or even make reusable reducers for common tasks such as pagination.</li>
</ul>
<p><strong>For</strong> <strong>example,</strong></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">function visibilityFilter(state = &#039;SHOW_ALL&#039;, action) {<br/>  switch (action.type) {<br/>    case &#039;SET_VISIBILITY_FILTER&#039;:<br/>      return action.filter<br/>    default:<br/>      return state<br/>  }<br/>}<br/><br/>function todos(state = [], action) {<br/>  switch (action.type) {<br/>    case &#039;ADD_TODO&#039;:<br/>      return [<br/>        ...state,<br/>        {<br/>          text: action.text,<br/>          completed: false<br/>        }<br/>      ]<br/>    case &#039;COMPLETE_TODO&#039;:<br/>      return state.map((todo, index) =&gt; {<br/>        if (index === action.index) {<br/>          return Object.assign({}, todo, {<br/>            completed: true<br/>          })<br/>        }<br/>        return todo<br/>      })<br/>    default:<br/>      return state<br/>  }<br/>}<br/><br/>import { combineReducers, createStore } from &#039;redux&#039;<br/>const reducer = combineReducers({ visibilityFilter, todos })<br/>const store = createStore(reducer)</code></pre> </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-three-principles-that-redux-follows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between React Native and React ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-react-native-and-react/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-react-native-and-react/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 28 Mar 2022 06:34:47 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[Difference between React JS and React Native]]></category>
		<category><![CDATA[difference between reactjs and react native]]></category>
		<category><![CDATA[How React Native is different from ReactJS ?]]></category>
		<category><![CDATA[is react and react native similar]]></category>
		<category><![CDATA[react js vs react native]]></category>
		<category><![CDATA[react js vs react native which is better]]></category>
		<category><![CDATA[react vs react native vs reactjs]]></category>
		<category><![CDATA[reactjs vs native]]></category>
		<category><![CDATA[Reactjs vs React Native]]></category>
		<category><![CDATA[ReactJS vs ReactNative]]></category>
		<category><![CDATA[syntax difference between reactjs and react native]]></category>
		<category><![CDATA[What are the main differences between ReactJS and React]]></category>
		<category><![CDATA[What is the difference between React Native and React?]]></category>
		<category><![CDATA[What is the difference between React.js and React Native?]]></category>
		<category><![CDATA[which is better react or react native]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4015</guid>

					<description><![CDATA[                 ReactJS               React Native &#160; In 2013 ReactJS initial was released. &#160; In 2015 React Native was released. &#160; ReactJS is used for developing web applications. It is a JS library. &#160; React Native is used for developing mobile application. It is a framework. &#160; &#160; In web [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4258" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js.jpg" alt="" width="1012" height="699" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js.jpg 1012w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js-300x207.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js-768x530.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js-390x269.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-vs-react-js-820x566.jpg 820w" sizes="(max-width: 1012px) 100vw, 1012px" /></p>
<table width="666">
<tbody>
<tr>
<td width="333">                <strong> ReactJS</strong></td>
<td width="333">              <strong>React Native</strong></td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>In 2013 ReactJS initial was released.</td>
<td width="333">&nbsp;</p>
<p>In 2015 React Native was released.</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>ReactJS is used for developing web applications. It is a JS library.</td>
<td width="333">&nbsp;</p>
<p>React Native is used for developing mobile application. It is a framework.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>In web application mainly rely on CSS or other JS libraries.</td>
<td width="333">&nbsp;</p>
<p>It has inbuilt features and therefore the output is better than ReactJS.</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>It uses React Router for navigation.</td>
<td width="333">&nbsp;</p>
<p>It uses entirely different library navigator or the purpose.</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>A single piece of code and it runs everywhere in the program.</td>
<td width="333">&nbsp;</p>
<p>It is compatible with all platforms, and it requires some platform-specific codes.</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>It takes very less time and efforts.</td>
<td width="333">&nbsp;</p>
<p>It takes more time and efforts.</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>It requires third party library tools for the development process.</td>
<td width="333">&nbsp;</p>
<p>It does not require third party library tools for the development process.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>It uses CSS components.</td>
<td width="333">&nbsp;</p>
<p>It uses animated APIs.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="333">&nbsp;</p>
<p>The browser code in React is rendered through Virtual DOM.</td>
<td width="333">&nbsp;</p>
<p>React Native uses Native APIs for rendering of components on mobile.</td>
</tr>
</tbody>
</table>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4261" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-and-reactjs.png" alt="" width="725" height="623" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-and-reactjs.png 725w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-and-reactjs-300x258.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-native-and-reactjs-390x335.png 390w" sizes="(max-width: 725px) 100vw, 725px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-react-native-and-react/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Prop Drilling ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-prop-drilling/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-prop-drilling/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 28 Mar 2022 05:39:45 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[Avoid Prop Drilling with React Context]]></category>
		<category><![CDATA[how to avoid prop drilling]]></category>
		<category><![CDATA[how to avoid prop drilling in react]]></category>
		<category><![CDATA[Prop Drilling]]></category>
		<category><![CDATA[prop drilling is good]]></category>
		<category><![CDATA[prop drilling react hooks]]></category>
		<category><![CDATA[prop drilling vs context]]></category>
		<category><![CDATA[react prop drilling example]]></category>
		<category><![CDATA[React Prop-drilling]]></category>
		<category><![CDATA[The upsides of prop drilling in React]]></category>
		<category><![CDATA[what is prop drilling and how can you avoid it]]></category>
		<category><![CDATA[What is prop drilling and how to avoid it ?]]></category>
		<category><![CDATA[what is prop drilling in react]]></category>
		<category><![CDATA[What is React Prop Drilling]]></category>
		<category><![CDATA[what problem does context api solve]]></category>
		<category><![CDATA[why is prop drilling bad]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4009</guid>

					<description><![CDATA[We pass a prop with another component with the help of all the components that come between, this method is known as prop drilling. Prop drilling is basically a situation when the same data is being sent at almost every level due to requirements in the final level. We refer prop drilling to the process [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4269 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling.png" alt="" width="923" height="745" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling.png 923w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling-300x242.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling-768x620.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling-390x315.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/props-drilling-820x662.png 820w" sizes="(max-width: 923px) 100vw, 923px" /></p>
<ul>
<li style="text-align: justify;">We pass a prop with another component with the help of all the components that come between, this method is known as prop drilling.</li>
<li style="text-align: justify;">Prop drilling is basically a situation when the same data is being sent at almost every level due to requirements in the final level.</li>
<li style="text-align: justify;">We refer prop drilling to the process of sending props from a higher-level component to a lower-level component.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4023 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-prop-drilling-in-react-1.png" alt="" width="618" height="380" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-prop-drilling-in-react-1.png 618w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-prop-drilling-in-react-1-300x184.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-prop-drilling-in-react-1-390x240.png 390w" sizes="(max-width: 618px) 100vw, 618px" /></p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4270" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-props.gif" alt="" width="1268" height="647" /></p>
<p><strong>For example,</strong></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">  import React, { useState } from &quot;react&quot;;<br/>  <br/>function Parent() {<br/>  const [fName, setfName] = useState(&quot;firstName&quot;);<br/>  const [lName, setlName] = useState(&quot;LastName&quot;);<br/>  return (<br/>    &lt;&gt;<br/>      &lt;div&gt;This is a Parent component&lt;/div&gt;<br/>      &lt;br /&gt;<br/>      &lt;ChildA fName={fName} lName={lName} /&gt;<br/>    &lt;/&gt;<br/>  );<br/>}<br/>  <br/>function ChildA({ fName, lName }) {<br/>  return (<br/>    &lt;&gt;<br/>      This is ChildA Component.<br/>      &lt;br /&gt;<br/>      &lt;ChildB fName={fName} lName={lName} /&gt;<br/>    &lt;/&gt;<br/>  );<br/>}<br/>  <br/>function ChildB({ fName, lName }) {<br/>  return (<br/>    &lt;&gt;<br/>      This is ChildB Component.<br/>      &lt;br /&gt;<br/>      &lt;ChildC fName={fName} lName={lName} /&gt;<br/>    &lt;/&gt;<br/>  );<br/>}<br/>  <br/>function ChildC({ fName, lName }) {<br/>  return (<br/>    &lt;&gt;<br/>      This is ChildC component.<br/>      &lt;br /&gt;<br/>      &lt;h3&gt; Data from Parent component is as follows:&lt;/h3&gt;<br/>      &lt;h4&gt;{fName}&lt;/h4&gt;<br/>      &lt;h4&gt;{lName}&lt;/h4&gt;<br/>    &lt;/&gt;<br/>  );<br/>}<br/>  <br/>export default Parent;</code></pre> </div>
<p>&nbsp;</p>
<p><strong>Output:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-4025 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1.png" alt="" width="876" height="692" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1.png 876w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1-300x237.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1-768x607.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1-390x308.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/output-for-prop-drilling-1-820x648.png 820w" sizes="(max-width: 876px) 100vw, 876px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-prop-drilling/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Arrow function in React ? How is it used ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-arrow-function-in-react-how-is-it-used/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-arrow-function-in-react-how-is-it-used/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Sat, 26 Mar 2022 12:33:08 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[arrow function in react]]></category>
		<category><![CDATA[arrow function in react example]]></category>
		<category><![CDATA[arrow function in react native]]></category>
		<category><![CDATA[passing functions to components]]></category>
		<category><![CDATA[react arrow function]]></category>
		<category><![CDATA[react arrow function component]]></category>
		<category><![CDATA[react arrow function props]]></category>
		<category><![CDATA[react arrow function vs function]]></category>
		<category><![CDATA[react arrow function with parameters]]></category>
		<category><![CDATA[react es6 arrow functions]]></category>
		<category><![CDATA[react onclick arrow function]]></category>
		<category><![CDATA[what is arrow function in react]]></category>
		<category><![CDATA[what is arrow function in react how is it used]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4006</guid>

					<description><![CDATA[They are more of a brief syntax for writing the function expression. It is also known as ‘fat arrow ‘(=&#62;) the functions. This keyword represented the object that called the function, which could be the window, the document, a button or whatever in a regular function. It allows to bind the context of the components [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4272" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions.png" alt="" width="954" height="635" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions.png 954w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions-300x200.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions-768x511.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions-390x260.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-functions-820x546.png 820w" sizes="(max-width: 954px) 100vw, 954px" /></p>
<ul>
<li style="text-align: justify;">They are more of a brief syntax for writing the function expression. It is also known as <em>‘fat arrow</em> ‘(<strong>=&gt;</strong>) the functions.</li>
<li style="text-align: justify;">This keyword represented the object that called the function, which could be the window, the document, a button or whatever in a regular function.</li>
<li style="text-align: justify;">It allows to bind the context of the components properly since in ES6 auto binding is not available by default.</li>
<li style="text-align: justify;">While working with the higher-order functions, Arrow functions are most useful.</li>
<li style="text-align: justify;">This keyword <em>always</em> represents the object that defined the arrow function in arrow function.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4274" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function.jpg" alt="" width="1057" height="728" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function.jpg 1057w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function-300x207.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function-1024x705.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function-768x529.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function-390x269.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/arrow-function-820x565.jpg 820w" sizes="(max-width: 1057px) 100vw, 1057px" /></p>
<p>For example, in <strong>regular</strong> <strong>functions:</strong></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">class Header {<br/>  constructor() {<br/>    this.color = &quot;Blue&quot;;<br/>  }<br/><br/>//Regular function:<br/>  changeColor = function() {<br/>    document.getElementById(&quot;demo&quot;).innerHTML += this;<br/>  }<br/>}<br/><br/>const myheader = new Header();<br/><br/>//The window object calls the function:<br/>window.addEventListener(&quot;load&quot;, myheader.changeColor);<br/><br/>//A button object calls the function:<br/>document.getElementById(&quot;btn&quot;).addEventListener(&quot;click&quot;, myheader.changeColor);</code></pre> </div>
<p>For example, in <strong>Arrow</strong> <strong>functions:</strong></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">class Header {<br/>  constructor() {<br/>    this.color = &quot;Blue&quot;;<br/>  }<br/><br/>//Arrow function:<br/>  changeColor = () =&gt; {<br/>    document.getElementById(&quot;demo&quot;).innerHTML += this;<br/>  }<br/>}<br/><br/>const myheader = new Header();<br/><br/><br/>//The window object calls the function:<br/>window.addEventListener(&quot;load&quot;, myheader.changeColor);<br/><br/>//A button object calls the function:<br/>document.getElementById(&quot;btn&quot;).addEventListener(&quot;click&quot;, myheader.changeColor);</code></pre> </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-arrow-function-in-react-how-is-it-used/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is a ref ? How do you use it ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-a-ref-how-do-you-use-it/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-a-ref-how-do-you-use-it/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Sat, 26 Mar 2022 10:56:36 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[example of ref in react]]></category>
		<category><![CDATA[how does ref work in react]]></category>
		<category><![CDATA[how to add ref in react]]></category>
		<category><![CDATA[how to clear ref in react]]></category>
		<category><![CDATA[how to create ref in react]]></category>
		<category><![CDATA[react get element by id functional component]]></category>
		<category><![CDATA[react useref]]></category>
		<category><![CDATA[ref in react]]></category>
		<category><![CDATA[ref in react example]]></category>
		<category><![CDATA[ref in react functional component]]></category>
		<category><![CDATA[ref react hooks]]></category>
		<category><![CDATA[Refs and the DOM]]></category>
		<category><![CDATA[use ref in react]]></category>
		<category><![CDATA[use ref in react example]]></category>
		<category><![CDATA[useref in react]]></category>
		<category><![CDATA[what is ref in react]]></category>
		<category><![CDATA[what is ref in react hook]]></category>
		<category><![CDATA[what is ref in react hook form]]></category>
		<category><![CDATA[what is ref used for in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4004</guid>

					<description><![CDATA[It is a function provided by React to access the DOM element and the React element that you might have created on your own. In React, a ref is a reference to a DOM element. It can be immediately placed in a variable. They are created with the help of useRef This variable is then [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">It is a function provided by React to access the DOM element and the React element that you might have created on your own.</li>
<li style="text-align: justify;">In React, a ref is a <strong>reference to a DOM element.</strong></li>
<li style="text-align: justify;">It can be immediately placed in a variable.</li>
<li style="text-align: justify;">They are created with the help of useRef</li>
<li style="text-align: justify;">This variable is then passed to a given React element (not a component) to get a reference to the underlying DOM element (that is, div, span, and so on).</li>
<li style="text-align: justify;">Properties are now available on the element itself.</li>
<li style="text-align: justify;">Refs are often referred to as an &#8220;escape hatch&#8221; to be able to work with a DOM element directly.</li>
<li style="text-align: justify;">They allow us to do certain operations that can&#8217;t be done through React otherwise, such as clearing or focusing an input.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4276 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/reactjs-ref.png" alt="" width="758" height="483" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/reactjs-ref.png 758w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/reactjs-ref-300x191.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/reactjs-ref-390x249.png 390w" sizes="(max-width: 758px) 100vw, 758px" /></p>
<p><strong>For Example,</strong></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">// using refs<br/><br/>class App extends React.Component {<br/><br/> constructor(){<br/><br/>  super();<br/><br/>  this.state = { sayings: &quot;&quot;};<br/><br/> }<br/><br/> update(e){<br/><br/>  this.setState({ sayings: this.refs.anything.value});<br/><br/> }<br/><br/> render(){<br/><br/>  return (<br/><br/>   &lt;div&gt;<br/><br/>    Welcome to Kaashiv &lt;input type=&quot;text&quot; ref=&quot;anything&quot;<br/><br/>      onChange = {this.update.bind(this)}/&gt;<br/><br/>   &lt;br/&gt;<br/><br/>   &lt;em&gt;{this.state.sayings}&lt;/em&gt;<br/><br/>  &lt;/div&gt;<br/><br/>  );<br/><br/> }<br/><br/>}<br/><br/> ReactDOM.render(&lt; App /&gt;, document.getElementById(&#039;root&#039;));<br/><br/> </code></pre> </div>
<p><strong> Output:</strong></p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-4020 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-ref..png" alt="" width="398" height="203" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-ref..png 398w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-ref.-300x153.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-ref.-390x199.png 390w" sizes="(max-width: 398px) 100vw, 398px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-a-ref-how-do-you-use-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What are the types of React component ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-types-of-react-component/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-types-of-react-component/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Sat, 26 Mar 2022 10:47:23 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[class component react]]></category>
		<category><![CDATA[functional component react]]></category>
		<category><![CDATA[react component example]]></category>
		<category><![CDATA[react component lifecycle]]></category>
		<category><![CDATA[react components]]></category>
		<category><![CDATA[react top-level-api components and its types in reactjs what are the types of components available in react]]></category>
		<category><![CDATA[reactjs components]]></category>
		<category><![CDATA[types of react components]]></category>
		<category><![CDATA[types of react js]]></category>
		<category><![CDATA[what are the types of components]]></category>
		<category><![CDATA[what is component in react]]></category>
		<category><![CDATA[what is the type of a react component]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4001</guid>

					<description><![CDATA[It is one of the core building blocks of React. In React we develop every application and it will be made of pieces, that is known as component. Components make the task of building UIs much easier. We see that UI broken down into multiple individual pieces called components and work on them independently and [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">It is one of the core building blocks of React.</li>
<li style="text-align: justify;">In React we develop every application and it will be made of pieces, that is known as component.</li>
<li style="text-align: justify;">Components make the task of building UIs much easier.</li>
<li style="text-align: justify;">We see that UI broken down into multiple individual pieces called components and work on them independently and merge them all in a parent component which will be your final UI.</li>
<li style="text-align: justify;">React Component basically return a piece of JSX code that tells what should be rendered on the screen.</li>
<li style="text-align: justify;">In React component there are two types:
<ul>
<li>Functional Components</li>
<li>Class Components</li>
</ul>
</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-4027 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/types-of-react-components-1.png" alt="" width="748" height="264" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/types-of-react-components-1.png 748w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/types-of-react-components-1-300x106.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/types-of-react-components-1-390x138.png 390w" sizes="(max-width: 748px) 100vw, 748px" /></p>
<h4 id="functional-components" style="text-align: justify;">Functional Components</h4>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4278" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/components-in-components.gif" alt="" width="1265" height="644" /></p>
<ul style="text-align: justify;">
<li>Functional components are simply JS functions.</li>
<li>In React we can create Functional Component by writing a JS function.</li>
<li>To create React app efficient, we use functional component only when we are sure that our component does not require to interact with any other components.</li>
<li>It does not require data from other components.</li>
</ul>
<p style="text-align: justify;"><strong>For example,</strong></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 Democomponent=()=&gt;<br/><br/>    {<br/><br/>            return &lt;h1&gt;Welcome to Kaashiv!&lt;/h1&gt;;<br/><br/>    }</code></pre> </div>
<h4 id=""><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4279 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/components-in-files.gif" alt="" width="1271" height="569" /></h4>
<h4 id="class-components" style="text-align: justify;">Class Components</h4>
<ul>
<li style="text-align: justify;">The class components are much like the functional component but has a few additional capabilities that makes class component a little more complicated than the functional components.</li>
<li style="text-align: justify;">The class components can work with each other where functional components are not aware of the other components in your program.</li>
<li style="text-align: justify;">From one class component to other class components, we can pass the data.</li>
<li style="text-align: justify;">In React we use JavaScript ES6 classes to create class-based components.</li>
</ul>
<p><strong>For example,</strong></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">class Democomponent extends React.Component<br/>   {<br/>       render(){<br/>             return &lt;h1&gt;Welcome to Kaashiv!&lt;/h1&gt;;<br/>      }<br/>  }</code></pre> </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-are-the-types-of-react-component/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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 loading="lazy" 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 loading="lazy" 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 loading="lazy" 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 React Router ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-router/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-router/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 24 Mar 2022 12:15:10 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[React Router]]></category>
		<category><![CDATA[react router example]]></category>
		<category><![CDATA[react router link]]></category>
		<category><![CDATA[react router switch]]></category>
		<category><![CDATA[react router tutorial]]></category>
		<category><![CDATA[react-router install]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[types of routing in react js]]></category>
		<category><![CDATA[what is exact in react router]]></category>
		<category><![CDATA[what is react router dom]]></category>
		<category><![CDATA[what is react router used for]]></category>
		<category><![CDATA[what is react-router-redux]]></category>
		<category><![CDATA[what is switch in react router]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3991</guid>

					<description><![CDATA[The standard library used for routing in React refers to React Router. In react, it permits us to build a single-page web application with navigation without even refreshing the page when the user navigates. It also allows changing the browser URL and will keep the user interface in sync with the URL. The component structure [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4284 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/reactjs-router.gif" alt="" width="650" height="328" /></p>
<ul>
<li>The standard library used for routing in React refers to React Router.</li>
<li style="text-align: justify;">In react, it permits us to build a single-page web application with navigation without even refreshing the page when the user navigates.</li>
<li style="text-align: justify;">It also allows changing the browser URL and will keep the user interface in sync with the URL.</li>
<li style="text-align: justify;">The component structure for calling the components, using which appropriate information, can be shown in React Router.</li>
<li style="text-align: justify;">Any other compatible routing library would also work with React.</li>
<li style="text-align: justify;">In react-router there are four major components:
<ul>
<li style="text-align: justify;"><strong>Browser Router</strong></li>
<li style="text-align: justify;"><strong>Routes</strong></li>
<li style="text-align: justify;"><strong>Route</strong></li>
<li style="text-align: justify;"><strong>Link</strong></li>
</ul>
</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-4032 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1.png" alt="" width="880" height="589" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1.png 880w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1-300x201.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1-768x514.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1-390x261.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-router-1-820x549.png 820w" sizes="(max-width: 880px) 100vw, 880px" /></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><strong> </strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-router/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to write comments in ReactJS ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/how-to-write-comments-in-reactjs/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/how-to-write-comments-in-reactjs/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Tue, 22 Mar 2022 07:39:47 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[comment in react Code Example]]></category>
		<category><![CDATA[comments in jsx]]></category>
		<category><![CDATA[comments list reactjs Code Example]]></category>
		<category><![CDATA[how to comment in react js shortcut]]></category>
		<category><![CDATA[How to comment in React JSX]]></category>
		<category><![CDATA[how to comment react code in vscode]]></category>
		<category><![CDATA[How to use comments in React]]></category>
		<category><![CDATA[How to write comments in React and JSX]]></category>
		<category><![CDATA[how to write comments in react js]]></category>
		<category><![CDATA[How to write comments in ReactJS ?]]></category>
		<category><![CDATA[react comment reply component]]></category>
		<category><![CDATA[react commenting best practices]]></category>
		<category><![CDATA[react comments npm]]></category>
		<category><![CDATA[React Native Comments]]></category>
		<category><![CDATA[single line comment in react js]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3976</guid>

					<description><![CDATA[ReactJS is a JS library used for building user interfaces. It is Declarative, Component-based and Technology stack agnostic. It is only designed for speed, simplicity, and scalability. It is some of the most popular libraries among web developers. For example(1), Comments for React Components: We can write comments in React using the double forward-slash // or [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;"><strong>ReactJS </strong>is a JS library used for building user interfaces.</li>
<li style="text-align: justify;">It is Declarative, Component-based and Technology stack agnostic.</li>
<li style="text-align: justify;">It is only designed for speed, simplicity, and scalability.</li>
<li style="text-align: justify;">It is some of the most popular libraries among web developers.</li>
</ul>
<p><strong>For example(1),</strong></p>
<p><strong>Comments for React Components: </strong></p>
<ul>
<li>We can write comments in React using the double forward-slash <strong>//</strong> or the asterisk format <strong>/* */</strong>, similar to regular JavaScript.</li>
</ul>
<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">import React, { Component } from &#039;react&#039;;<br/>  <br/>// This is a comment<br/>  <br/>class App extends Component {<br/>  <br/>    /* This is <br/>    also a comment*/<br/>    render() {<br/>        return (<br/>            &lt;div&gt;<br/>                &lt;h1&gt;Welcome to Kaashiv&lt;/h1&gt;<br/>            &lt;/div&gt;<br/>        );<br/>    }<br/>}<br/>  <br/>export default App;</code></pre> </div>
<p><strong>Output :</strong></p>
<p><img loading="lazy" decoding="async" class="img-responsive aligncenter wp-image-3977 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv.png" alt="" width="1563" height="764" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv.png 1563w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-300x147.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1024x501.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-768x375.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1536x751.png 1536w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-390x191.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-820x401.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1180x577.png 1180w" sizes="(max-width: 1563px) 100vw, 1563px" /></p>
<p><strong>For example(2),</strong></p>
<p>In example(1) does not work when we want to comment on things inside the <strong>render block</strong>. we use JSX inside the render block and must use the multi-line comments in curly braces <strong>{/* */} </strong>.</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">import React, { Component } from &#039;react&#039;;<br/>  <br/>class App extends Component {<br/>    render() {<br/>        return (      <br/>            &lt;div&gt;<br/>                // This is not a valid comment<br/>                /* Neither is this */<br/>  <br/>                { /* THIS ONE IS A VALID COMMENT */ }<br/>}<br/>                  <br/>                &lt;h1&gt;Welcome to Kaashiv&lt;/h1&gt;<br/>            &lt;/div&gt;<br/>        );<br/>    }<br/>}<br/>  <br/>export default App; </code></pre> </div>
<p><strong>Output:</strong></p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3978 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1.png" alt="" width="1489" height="727" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1.png 1489w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-300x146.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-1024x500.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-768x375.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-390x190.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-820x400.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/welcome-to-kaashiv-1-1180x576.png 1180w" sizes="(max-width: 1489px) 100vw, 1489px" /></p>
<p><strong>For example(3),</strong></p>
<p>We must remember, that even though JSX gets rendered just like normal HTML. It is actually a syntax extension to JavaScript. So, using <strong>&lt;!– –&gt;</strong> as we did with <strong>HTML and XML</strong> will not work.</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">import React, { Component } from &#039;react&#039;;<br/>  <br/>class App extends Component {<br/>    render() {<br/>        return (     <br/>            &lt;div&gt;<br/>                &lt;!-- This is not a valid comment --&gt;<br/>                  <br/>                {/* THIS ONE IS A VALID COMMENT */}<br/>                  <br/>                &lt;h1&gt;Welcome to Kaashiv&lt;/h1&gt;<br/>            &lt;/div&gt;<br/>        );<br/>    }<br/>}<br/>  <br/>export default App;</code></pre> </div>
<p><strong>Output:</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4038" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile.png" alt="" width="903" height="323" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile.png 903w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile-300x107.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile-768x275.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile-390x140.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/failed-to-compile-820x293.png 820w" sizes="(max-width: 903px) 100vw, 903px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/how-to-write-comments-in-reactjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Flux ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-flux/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-flux/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Tue, 22 Mar 2022 07:18:42 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[data flow of flux in react]]></category>
		<category><![CDATA[flux architecture react]]></category>
		<category><![CDATA[flux in javascript]]></category>
		<category><![CDATA[flux in react js example]]></category>
		<category><![CDATA[react flux tutorial]]></category>
		<category><![CDATA[react flux vs redux]]></category>
		<category><![CDATA[what is flux and redux in react]]></category>
		<category><![CDATA[what is flux and redux in react js]]></category>
		<category><![CDATA[what is flux concept in react js]]></category>
		<category><![CDATA[what is flux in react js]]></category>
		<category><![CDATA[what is flux in react native]]></category>
		<category><![CDATA[what is flux in reactive programming]]></category>
		<category><![CDATA[what is flux pattern in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3973</guid>

					<description><![CDATA[It is an application architecture that Facebook makes use of internally for constructing the client-side web application with React . It is a programming concept, where the data is a Unidirectional Data Flow model. The project has dynamic data, where it is useful. We need to maintain the data updated in an effective The runtime [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4288 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux.jpg" alt="" width="1134" height="641" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux.jpg 1134w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux-300x170.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux-1024x579.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux-768x434.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux-390x220.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/react-flux-820x464.jpg 820w" sizes="(max-width: 1134px) 100vw, 1134px" /></p>
<ul>
<li style="text-align: justify;">It is an application architecture that Facebook makes use of internally for constructing the client-side web application with <a href="https://www.wikitechy.com/interview-questions/reactjs/what-is-react/">React</a> .</li>
<li style="text-align: justify;">It is a programming concept, where the data is a Unidirectional Data Flow model.</li>
<li style="text-align: justify;">The project has dynamic data, where it is useful.</li>
<li style="text-align: justify;">We need to maintain the data updated in an effective</li>
<li style="text-align: justify;">The runtime errors become reduced.</li>
</ul>
<p><img loading="lazy" decoding="async" class="img-responsive alignnone wp-image-4040 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1.png" alt="" width="1355" height="599" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1.png 1355w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-300x133.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-1024x453.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-768x340.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-390x172.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-820x362.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-flux-1-1-1180x522.png 1180w" sizes="(max-width: 1355px) 100vw, 1355px" /></p>
<ul>
<li>In this application, there are four major roles:
<ul>
<li>Action</li>
<li>Dispatcher</li>
<li>Store</li>
<li>View</li>
</ul>
</li>
</ul>
<h4 id="action">Action:</h4>
<ul>
<li>In this creator an action from method parameter,assign it a type and then provide to a dispatcher.</li>
</ul>
<h4 id="dispatcher">Dispatcher:</h4>
<ul>
<li>It sends every action to all stores via callbacks that have registered with it.</li>
</ul>
<h4 id="store">Store:</h4>
<ul>
<li>It updates themselves in response to an action ,emit the change event to alert the controller view.</li>
</ul>
<h4 id="view">View:</h4>
<ul>
<li>It retrieves new data from the stores and provides the new data to their descendants in the component tree.</li>
</ul>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-flux/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>
		<item>
		<title>Why we use React instead of other frameworks, like Angular ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/why-we-use-react-instead-of-other-frameworks-like-angular/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/why-we-use-react-instead-of-other-frameworks-like-angular/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 12:07:29 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[angular vs react performance]]></category>
		<category><![CDATA[are angular and react similar]]></category>
		<category><![CDATA[difference between react and angular 8]]></category>
		<category><![CDATA[is angular a framework]]></category>
		<category><![CDATA[is react better or angular]]></category>
		<category><![CDATA[react to angular]]></category>
		<category><![CDATA[react vs angular]]></category>
		<category><![CDATA[react vs angular future]]></category>
		<category><![CDATA[which is more powerful angular or react]]></category>
		<category><![CDATA[why react is preferred over angular]]></category>
		<category><![CDATA[why we use react js instead of angular]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3967</guid>

					<description><![CDATA[In front-end JavaScript framework and library open source, most of the web developers, would agree upon the fact that both Angular and React. Since Angular arrived much in advance in evaluation to React, it have become one of the widely used programming languages to constructed best web In single-page applications, One of the other factors [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>In front-end JavaScript framework and library open source, most of the web developers, would agree upon the fact that both Angular and React.</li>
<li>Since Angular arrived much in advance in evaluation to React, it have become one of the widely used programming languages to constructed best web</li>
<li>In single-page applications, One of the other factors that worked in its favour was the support and trustworthiness of Google, helping the developers to solve many issues related to development.</li>
<li>In paradigm, there was a drift  made up on the center stage once React.</li>
<li>The developers also started to moving from Angular to React as it was much better than Angular in terms of speed, efficiency, view library, simple API, and lightweight components.</li>
<li>For developers, Angular had a few drawbacks causing problems and irritation. They started to look for other alternatives.</li>
</ul>
<h4 id="key-features-of-angularjs"><strong>Key Features of AngularJS:</strong></h4>
<ul>
<li>Observables are just a few of Angular’s highlights and Built-in support for AJAX, HTTP.</li>
<li>Inline with current technologies.</li>
<li>Error-handling support has been improved.</li>
<li>Local CSS / shadow DOM.</li>
<li>Typescript is time-saving.</li>
<li>Validation and forms.</li>
</ul>
<h4 id="key-features-of-reactjs"><strong>Key Features of ReactJS:</strong></h4>
<ul>
<li>It is  ability to use third-party libraries.</li>
<li>Saving the time.</li>
<li>Simplicity and Composability.</li>
<li>lightning-fast speed and Improved user experience.</li>
<li>More rapid development</li>
<li>One-directional data binding provides code stability</li>
<li>Reacts the component.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/why-we-use-react-instead-of-other-frameworks-like-angular/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is State and Props ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-state-and-props/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-state-and-props/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 11:53:19 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[difference between props and state in react with example]]></category>
		<category><![CDATA[props and state in react]]></category>
		<category><![CDATA[props in react]]></category>
		<category><![CDATA[props vs state in react]]></category>
		<category><![CDATA[props vs this props]]></category>
		<category><![CDATA[react state]]></category>
		<category><![CDATA[reactjs state vs props]]></category>
		<category><![CDATA[state and props in react js]]></category>
		<category><![CDATA[state and props in react native]]></category>
		<category><![CDATA[state vs props]]></category>
		<category><![CDATA[what are the difference between props and state]]></category>
		<category><![CDATA[what is props in react js]]></category>
		<category><![CDATA[what is state in react]]></category>
		<category><![CDATA[what is stats and props in angular]]></category>
		<category><![CDATA[what is stats and props in html]]></category>
		<category><![CDATA[what is stats and props in javascript]]></category>
		<category><![CDATA[what is stats and props in react]]></category>
		<category><![CDATA[what is the difference between state and props in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3963</guid>

					<description><![CDATA[State: It is an updatable structure that is used to contain data or information about the component and can change over time. State Can be modified using this.setState. State can be asynchronous The component can be directly accessed or modified inside the component. It is kept as simple as possible. It represents the component&#8217;s local state [&#8230;]]]></description>
										<content:encoded><![CDATA[<h3 id="state"><strong>State:</strong></h3>
<ul>
<li style="text-align: justify;">It is an updatable structure that is used to contain data or information about the component and can change over time.</li>
<li style="text-align: justify;">State <strong>Can be modified using this.setState. </strong>State can be<strong> asynchronous</strong></li>
<li style="text-align: justify;">The component can be directly accessed or modified inside the component.</li>
<li style="text-align: justify;">It is kept as simple as possible.</li>
<li style="text-align: justify;">It represents the component&#8217;s local state or information.</li>
</ul>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-4045 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-props-1.jpg" alt="" width="458" height="288" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-props-1.jpg 458w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-props-1-300x189.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-props-1-390x245.jpg 390w" sizes="(max-width: 458px) 100vw, 458px" /></p>
<p>For Example,</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">class Test extends React.Component {    <br/>    constructor() {    <br/>        this.state = {      <br/>            id: 1,      <br/>            name: &quot;kaashiv&quot;    <br/>        };  <br/>    }    <br/>    <br/>    render() {    <br/>        return (      <br/>            &lt;div&gt;        <br/>              &lt;p&gt;{this.state.id}&lt;/p&gt;        <br/>              &lt;p&gt;{this.state.name}&lt;/p&gt;      <br/>            &lt;/div&gt;    <br/>        );  <br/>    }<br/>}</code></pre> </div>
<h3 id="props">Props:</h3>
<ul>
<li>In UI that components in React are used again and again.</li>
<li>In the component, we need to change the content inside.</li>
<li>It is an object which stores the value of attributes of a tag and works similarly to the HTML attributes.</li>
<li>From one component to other components, It allows the passing of data.</li>
<li>While inside the component we cannot modify the props, because they are immutable.</li>
<li>They are used to passing data between React components.</li>
</ul>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-4047 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-state-1.jpg" alt="" width="460" height="255" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-state-1.jpg 460w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-state-1-300x166.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-state-1-390x216.jpg 390w" sizes="(max-width: 460px) 100vw, 460px" /></p>
<p>For Example,</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">class ParentComponent extends Component {    <br/>    render() {    <br/>        return (        <br/>            &lt;ChildComponent name=&quot;Second Child&quot; /&gt;    <br/>        );  <br/>    }<br/>}<br/><br/>const ChildComponent = (props) =&gt; {    <br/>    return &lt;p&gt;{props.name}&lt;/p&gt;; </code></pre> </div>
<h3 id="difference-between-state-and-props"><strong>Difference between State and Props :</strong></h3>
<table width="635">
<tbody>
<tr>
<td width="318">                     <strong><em>State</em></strong></td>
<td width="318"><strong>                     <em>Props</em></strong></td>
</tr>
<tr>
<td width="318">Data passed within the component only.</td>
<td width="318"> Data passed from one component To another.</td>
</tr>
<tr>
<td width="318">It becomes Mutable.</td>
<td width="318"> It becomes immutable</td>
</tr>
<tr>
<td width="318">It is for both read and write.</td>
<td width="318"> It is only for read.</td>
</tr>
<tr>
<td width="318">It becomes long for properties.</td>
<td width="318">It becomes short for properties.</td>
</tr>
<tr>
<td width="318">It can be modified.</td>
<td width="318">It cannot be modified.</td>
</tr>
<tr>
<td width="318">Performance is worse.</td>
<td width="318">Performance is better.</td>
</tr>
<tr>
<td width="318">It should be managed in your view-controller</td>
<td width="318">It is used to pass data down from your view-controller</td>
</tr>
<tr>
<td width="318">It pass down with props instead.</td>
<td width="318">It is used to pass data to child components.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-state-and-props/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Redux ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-redux/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-redux/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 11:06:08 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[react redux]]></category>
		<category><![CDATA[react with redux]]></category>
		<category><![CDATA[redux react tutorial]]></category>
		<category><![CDATA[redux tutorial]]></category>
		<category><![CDATA[what is redux]]></category>
		<category><![CDATA[what is redux in angular]]></category>
		<category><![CDATA[what is redux in games]]></category>
		<category><![CDATA[what is redux in react]]></category>
		<category><![CDATA[what is redux in react native]]></category>
		<category><![CDATA[why use redux]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3959</guid>

					<description><![CDATA[Redux is an open-source JS library used to manage application state. React makes use of Redux for constructing the user interface. Dan Abramov and Andrew Clark introduced this in 2015. The official React binding for Redux is React Redux. It creates a process and procedures to interact with the store so that components will not just update [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Redux is an open-source JS library used to manage application state.</li>
<li style="text-align: justify;">React makes use of Redux for constructing the user interface.</li>
<li style="text-align: justify;"><strong>Dan Abramov</strong> and <strong>Andrew Clark introduced this in 2015</strong><strong>.</strong></li>
<li style="text-align: justify;">The official React binding for Redux <strong>is React Redux.</strong></li>
<li style="text-align: justify;">It creates a process and procedures to interact with the store so that components will not just update or read the store randomly. Similar to the bank.</li>
<li style="text-align: justify;">They dispatch <strong>Actions </strong>to the <strong>Store</strong> to update data,then allows React components to read data from a Redux Store.</li>
<li style="text-align: justify;">Redux helps apps to scale by providing a sensible way to manage state through a unidirectional data flow model.</li>
<li style="text-align: justify;">It has no dependencies and is very small.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4055" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2.png" alt="" width="1950" height="1318" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2.png 1950w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-300x203.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-1024x692.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-768x519.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-1536x1038.png 1536w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-390x264.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-820x554.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-2-1180x798.png 1180w" sizes="(max-width: 1950px) 100vw, 1950px" /></p>
<p><strong>Uses of Redux :</strong></p>
<ul>
<li>React Redux is the official <strong>UI bindings </strong>for react Application.</li>
<li>It is stored up to date with any API modifications to make certain that your React additives behave as expected.</li>
<li>It Implements Performance Optimizations For You.</li>
</ul>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-4049 size-large" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-1024x629.png" alt="" width="1024" height="629" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-1024x629.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-300x184.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-768x472.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-1536x944.png 1536w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-2048x1259.png 2048w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-390x240.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-820x504.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-redux-1-1180x725.png 1180w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><strong>Store :</strong></p>
<ul>
<li>The entire state of your application lists where placed in a store.</li>
<li>In Redux. It is like a brain responsible for all moving parts.</li>
<li>It has a dispatch function and then manages the status of the application</li>
</ul>
<p><strong>Action :</strong></p>
<ul>
<li>Action is sent or dispatched from the view which are payloads that can be read by Reducers.</li>
<li>It is a natural object created to store the facts of the user&#8217;s event.</li>
<li>It consists of information along with type of action, time of occurrence, location of occurrence, its coordinates, and which state it aims to change.</li>
</ul>
<p><strong>Reducer :</strong></p>
<ul>
<li>It updates the store via the state accordingly and read the payloads from the actions.</li>
<li>At initial state, it is a pure function to return a new state.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-redux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is React Hooks ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-hooks/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-hooks/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 10:45:53 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[hooks in react js]]></category>
		<category><![CDATA[list of react hooks]]></category>
		<category><![CDATA[React Hooks]]></category>
		<category><![CDATA[react hooks example]]></category>
		<category><![CDATA[react hooks interview questions]]></category>
		<category><![CDATA[React Hooks Tutorial]]></category>
		<category><![CDATA[react hooks vs redux]]></category>
		<category><![CDATA[types of hooks in react]]></category>
		<category><![CDATA[what is custom hooks in react]]></category>
		<category><![CDATA[what is lifecycle hooks in react]]></category>
		<category><![CDATA[what is react hooks]]></category>
		<category><![CDATA[what is react hooks interview questions]]></category>
		<category><![CDATA[what is react hooks used for]]></category>
		<category><![CDATA[what is react hooks vs redux]]></category>
		<category><![CDATA[what is usereducer in react hooks]]></category>
		<category><![CDATA[what is usestate in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3957</guid>

					<description><![CDATA[Hooks are the new feature added in the React 16.8 It lets you use state and different React functions without writing a class. React concepts does not replace your knowledge. Inside classes do not work. Hooks are the functions that &#8220;hook into&#8221; React state and lifecycle features from the function. For example: We must import Hooks [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Hooks are the new feature added in the React 16.8</li>
<li style="text-align: justify;">It lets you use state and different React functions without writing a class.</li>
<li style="text-align: justify;">React concepts does not replace your knowledge.</li>
<li style="text-align: justify;">Inside classes do not work.</li>
<li style="text-align: justify;">Hooks are the functions that &#8220;hook into&#8221; React state and lifecycle features from the function.</li>
</ul>
<h4 id="for-example">For example:</h4>
<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">import React, { useState } from &quot;react&quot;;<br/>import ReactDOM from &quot;react-dom&quot;;<br/><br/>function FavoriteColor() {<br/>  const [color, setColor] = useState(&quot;blue&quot;);<br/><br/>  return (<br/>    &lt;&gt;<br/>      &lt;h1&gt;My favorite color is {color}!&lt;/h1&gt;<br/>      &lt;button<br/>        type=&quot;button&quot;<br/>        onClick={() =&gt; setColor(&quot;yellow&quot;)}<br/>      &gt;Yellow&lt;/button&gt;<br/>      &lt;button<br/>        type=&quot;button&quot;<br/>        onClick={() =&gt; setColor(&quot;blue&quot;)}<br/>      &gt;Blue&lt;/button&gt;<br/>      &lt;button<br/>        type=&quot;button&quot;<br/>        onClick={() =&gt; setColor(&quot;orange&quot;)}<br/>      &gt;Orange&lt;/button&gt;<br/>      &lt;button<br/>        type=&quot;button&quot;<br/>        onClick={() =&gt; setColor(&quot;violet&quot;)}<br/>      &gt;Violet&lt;/button&gt;<br/>    &lt;/&gt;<br/>  );<br/>}<br/><br/>ReactDOM.render(&lt;FavoriteColor /&gt;, document.getElementById(&#039;root&#039;));</code></pre> </div>
<p>We must <strong>import</strong> Hooks from <strong>react. </strong>The <strong>useState</strong> is used to track the application state.</p>
<h4 id="rules-of-hooks"><strong>Rules of Hooks:</strong></h4>
<ul>
<li>Call Hooks from React function components.</li>
<li>Call Hooks from Top level.</li>
<li>It cannot be conditional.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-react-hooks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between class component and functional component</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/difference-between-class-component-and-functional-component/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/difference-between-class-component-and-functional-component/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 10:20:54 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[are functional components faster than class components]]></category>
		<category><![CDATA[class component react]]></category>
		<category><![CDATA[Components and Props]]></category>
		<category><![CDATA[difference between class component and functional component in react]]></category>
		<category><![CDATA[Differences between Functional Components]]></category>
		<category><![CDATA[functional component to class component]]></category>
		<category><![CDATA[Functional Components vs. Class Components in React.js]]></category>
		<category><![CDATA[Functional Components Vs. Class Components in ReactJS]]></category>
		<category><![CDATA[functional vs class components react]]></category>
		<category><![CDATA[Functional vs Class-Components in React]]></category>
		<category><![CDATA[react class component example]]></category>
		<category><![CDATA[React Class Component vs Functional Component]]></category>
		<category><![CDATA[react functional component]]></category>
		<category><![CDATA[react pure functional component]]></category>
		<category><![CDATA[why functional components are better]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3954</guid>

					<description><![CDATA[&#160;                  Class component &#160; Functional component  Class-based Components uses ES6 class syntax. Functional Components are simpler comparing to class-based functions. &#160; The lifecycle methods can be used. Functional Components mainly focuses on the UI of the application, not on the behavior. More code to write. Easy to write. Used for presenting static data. Used [&#8230;]]]></description>
										<content:encoded><![CDATA[<table width="690">
<tbody>
<tr>
<td width="366">&nbsp;</p>
<p><strong>                 Class component</strong></td>
<td width="324">&nbsp;</p>
<p><strong>Functional component</strong></td>
</tr>
<tr>
<td width="366"> Class-based Components uses ES6 class syntax.</td>
<td width="324">Functional Components are simpler comparing to class-based functions.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="366">The lifecycle methods can be used.</td>
<td width="324">Functional Components mainly focuses on the UI of the application, not on the behavior.</td>
</tr>
<tr>
<td width="366">More code to write.</td>
<td width="324">Easy to write.</td>
</tr>
<tr>
<td width="366">Used for presenting static data.</td>
<td width="324">Used for dynamic source of data.</td>
</tr>
<tr>
<td width="366">Can’t handle fetching data.</td>
<td width="324">Handles any data that might change.</td>
</tr>
<tr>
<td width="366">It must have a render() method.</td>
<td width="324">It doesn’t have a render() method.</td>
</tr>
<tr>
<td width="366">Here,React lifecycle methods (like componentDidMount, etc.) are used</td>
<td width="324">React hooks are there to be as a better alternative to the traditional React lifecycle methods.</td>
</tr>
<tr>
<td width="366">For e.g:</p>
<p>const [name,SetName]= React.useState(‘ ‘)</td>
<td width="324">For e.g:</p>
<p>constructor(props) {</p>
<p>super(props);</p>
<p>this.state = {name: ‘ ‘}</p>
<p>}</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="366">In functional components to make them Stateful, Hooks can be easily used.</td>
<td width="324">In class component to implement hooks,It requires different syntax.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/difference-between-class-component-and-functional-component/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is JSX ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-jsx/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-jsx/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 10:00:03 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[introducing jsx]]></category>
		<category><![CDATA[jsx example]]></category>
		<category><![CDATA[jsx file]]></category>
		<category><![CDATA[jsx full form]]></category>
		<category><![CDATA[jsx full form in react]]></category>
		<category><![CDATA[jsx in react - explained with examples]]></category>
		<category><![CDATA[jsx tutorial]]></category>
		<category><![CDATA[jsx vs js]]></category>
		<category><![CDATA[react jsx]]></category>
		<category><![CDATA[reactjs jsx]]></category>
		<category><![CDATA[what is a jsx]]></category>
		<category><![CDATA[what is jsx in react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3952</guid>

					<description><![CDATA[JSX is known as JavaScript XML. This file makes the React application robust. Boosts its performance. We can write HTML structures in the same file that contains JavaScript code,while using JSX. It is easy to understand in HTML file. It is like XML/HTML, JSX tags have a tag name, attributes, and children. Let’s see how JSX [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">JSX is known as <strong>JavaScript XML</strong>.</li>
<li style="text-align: justify;">This file makes the React application robust.</li>
<li style="text-align: justify;">Boosts its performance.</li>
<li style="text-align: justify;">We can write HTML structures in the same file that contains JavaScript code,while using JSX.</li>
<li style="text-align: justify;">It is easy to understand in HTML file.</li>
<li style="text-align: justify;">It is like <strong>XML/HTML, JSX</strong> tags have a tag name, attributes, and children.</li>
</ul>
<p style="text-align: justify;">Let’s see <strong>how JSX works</strong>:</p>
<p style="text-align: justify;"> Create an element without using JSX.</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 text = React.createElement(&#039;p&#039;, {}, &#039;Welcome to kaashiv&#039;);<br/><br/>const container = React.createElement(&#039;div&#039;,&#039;{}&#039;,text );<br/><br/>ReactDOM.render(container,rootElement);</code></pre> </div>
<p style="text-align: justify;"> Create an element using JSX:</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 container = (<br/><br/>&lt;div&gt;<br/><br/>  &lt;p&gt;Welcome to kaashiv&lt;/p&gt;<br/><br/>&lt;/div&gt;<br/><br/>);<br/><br/>ReactDOM.render(container,rootElement);</code></pre> </div>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-jsx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between element and component ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-element-and-component/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-element-and-component/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 09:49:20 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[difference between element and compound with example]]></category>
		<category><![CDATA[Difference between React Component and React Element]]></category>
		<category><![CDATA[element and component in react]]></category>
		<category><![CDATA[elements and components meaning]]></category>
		<category><![CDATA[what is component element example]]></category>
		<category><![CDATA[what is the difference between a component and an element of an array]]></category>
		<category><![CDATA[What is the difference between Element and Component]]></category>
		<category><![CDATA[what is the difference between element and component react]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3950</guid>

					<description><![CDATA[&#160;  Element &#160; Component It is an object describing what you would like to project on the screen in terms of the DOM nodes or other components. It is a function or class that accepts an input and returns a React element. &#160; It contains other elements in its props. &#160; It can be a [&#8230;]]]></description>
										<content:encoded><![CDATA[<table width="670">
<tbody>
<tr>
<td width="344">&nbsp;</p>
<p><strong> </strong><strong>Element</strong></td>
<td width="326">&nbsp;</p>
<p><strong>Component</strong></td>
</tr>
<tr>
<td width="344">It is an object describing what you would like to project on the screen in terms of the DOM nodes or other components.</td>
<td width="326">It is a function or class that accepts an input and returns a React element.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>It contains other elements in its props.</td>
<td width="326">&nbsp;</p>
<p>It can be a class with a render() method.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>It describes what we want to see on the screen</td>
<td width="326">&nbsp;</p>
<p>It is a template. A blueprint. A global definition.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>It is an immutable description object and you can not apply any methods on it</td>
<td width="326">&nbsp;</p>
<p>It has to keep references to its DOM nodes and to the instances of the child components.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>There is no any method used.</td>
<td width="326">&nbsp;</p>
<p>The lifecycle method is used for each element.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>They are immutable i,e once created cannot be changed.</td>
<td width="326">&nbsp;</p>
<p>The state in a component is mutable.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>React Hooks cannot be used with elements as elements are immutable.</td>
<td width="326">&nbsp;</p>
<p>React hooks can be used with both functional and class components</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>Elements are faster.</td>
<td width="326">&nbsp;</p>
<p>Components are slower.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>It is an object representation of a DOM node.</td>
<td width="326">&nbsp;</p>
<p>It is an object representation of the DOM tree.</td>
</tr>
<tr>
<td width="344">&nbsp;</p>
<p>&nbsp;</p>
<p>e.g,<br />
&lt;button class=”white”&gt; &lt;/button&gt;</p>
<p>&nbsp;</td>
<td width="326">e.g,</p>
<p>const LogIn = () =&gt; (</p>
<p>&lt;div&gt;</p>
<p>&lt;p&gt; Login &lt;/p&gt;</p>
<p>&lt;button&gt; Continue &lt;/button&gt;</p>
<p>&lt;button color = “orange”&gt; Cancel &lt;/button&gt;</p>
<p>&lt;/div&gt;</p>
<p>);</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-difference-between-element-and-component/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the purpose of using super constructor with props argument ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-purpose-of-using-super-constructor-with-props-argument/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-purpose-of-using-super-constructor-with-props-argument/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 21 Mar 2022 09:29:59 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[super(props) in React]]></category>
		<category><![CDATA[superprops in functional component]]></category>
		<category><![CDATA[superprops react]]></category>
		<category><![CDATA[what is constructor in react]]></category>
		<category><![CDATA[what is constructorprops in react]]></category>
		<category><![CDATA[what is super in react constructor]]></category>
		<category><![CDATA[what is superprops]]></category>
		<category><![CDATA[what is the purpose of using super constructor with props argument]]></category>
		<category><![CDATA[What's the difference between super() and super(props) in React]]></category>
		<category><![CDATA[Why Do We Write super(props)?]]></category>
		<category><![CDATA[why use super in constructor javascript]]></category>
		<category><![CDATA[why use super in constructor react]]></category>
		<category><![CDATA[why we pass props in constructor]]></category>
		<category><![CDATA[why we use constructor and super in react js]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3948</guid>

					<description><![CDATA[This method has been known as, a child class constructor cannot create use of this reference until super() . The same applies for ES6 sub-classes as well. The main reason of passing props parameter to super() call is to access this.props in your child constructors. The super() is a requirement, while implementing the constructor() function inside a React component. [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">This method has been known as, a child class constructor cannot create use of this reference until <strong>super()</strong> .</li>
<li style="text-align: justify;">The same applies for ES6 sub-classes as well.</li>
<li style="text-align: justify;">The main reason of passing props parameter to <strong>super()</strong> call is to access <strong>this.props</strong> in your child constructors.</li>
<li style="text-align: justify;">The <strong>super()</strong> is a requirement, while implementing the <strong>constructor()</strong> function inside a React component.</li>
<li style="text-align: justify;">For example, <strong>super(props)</strong> would call the React.</li>
<li style="text-align: justify;">Component constructor passing in props as the argument.</li>
</ul>
<h4 id="for-example-in-passing-props">For example in <strong>Passing props</strong></h4>
<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">class MyComponent extends React.Component {<br/>  constructor(props) {<br/>    super(props)<br/><br/>    console.log(this.props) // prints { name: &#039;bharath&#039;, age: 23}<br/>  }<br/>}</code></pre> </div>
<p>&nbsp;</p>
<h4 id="for-example-in-not-passing-props">For example in <strong>Not passing props</strong></h4>
<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">class MyComponent extends React.Component {<br/>  constructor(props) {<br/>    super()<br/><br/>    console.log(this.props) // prints undefined<br/><br/>    // but props parameter is still available<br/>    console.log(props) // prints { name: &#039; bharath &#039;, age: 23 }<br/>  }<br/><br/>  render() {<br/>    // no difference outside constructor<br/>    console.log(this.props) // prints { name: &#039; bharath &#039;, age: 23 }<br/>  }<br/>}</code></pre> </div>
<ul>
<li>In The above code snippets shows that <strong>this.props</strong> is different only within the constructor.</li>
<li>It would be the same outside the constructor.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-the-purpose-of-using-super-constructor-with-props-argument/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is React ?</title>
		<link>https://www.wikitechy.com/interview-questions/reactjs/what-is-react/</link>
					<comments>https://www.wikitechy.com/interview-questions/reactjs/what-is-react/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Sat, 19 Mar 2022 12:50:40 +0000</pubDate>
				<category><![CDATA[ReactJS]]></category>
		<category><![CDATA[react tutorial]]></category>
		<category><![CDATA[react vs angular]]></category>
		<category><![CDATA[what is react]]></category>
		<category><![CDATA[what is react component]]></category>
		<category><![CDATA[what is react developer]]></category>
		<category><![CDATA[what is react hooks]]></category>
		<category><![CDATA[what is react js]]></category>
		<category><![CDATA[what is react js and node js]]></category>
		<category><![CDATA[what is react native]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=3940</guid>

					<description><![CDATA[• It is a front-end JS library developed by Facebook in 2011. • It was created by Jordan Walke. • It is quite the buzzword in the industry these days. • It is useful for developing user interfaces specifically in applications with a single page. • It is also for developing interactive view layer of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>• It is a <strong>front-end</strong> JS library developed by <strong>Facebook in 2011</strong>.<br />
• It was created by <strong>Jordan Walke</strong>.<br />
• It is quite the <strong>buzzword</strong> in the industry these days.<br />
• It is useful for developing user interfaces specifically in applications with a single page.<br />
• It is also for developing <strong>interactive view</strong> layer of web and mobile apps.<br />
• It will make use of the virtual DOM rather than real DOM (<strong>Data Object Model</strong>) as RealDOM manipulations are expensive.<br />
• It allows us to <strong>create reusable behavior</strong> across any of our components with React hooks.<br />
• It is provided by the <strong>Redux</strong> or <strong>Flux</strong> in MVC architecture.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4052" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-react-1.jpg" alt="" width="700" height="368" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-react-1.jpg 700w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-react-1-300x158.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/what-is-react-1-390x205.jpg 390w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="advantages-of-react"><strong>Advantages of React</strong></h4>
<ul>
<li>Makes JavaScript coding easier.</li>
<li>Template designing made easy.</li>
<li>Provides amazing developer tools.</li>
<li>Reusable Components.</li>
<li>SEO Friendly.</li>
</ul>
<h4 id="disadvantages-of-react"><strong>Disadvantages of React</strong></h4>
<ul>
<li>JSX as a barrier.</li>
<li>Lack of Documentation.</li>
<li>Poor Documentation.</li>
<li>It Covers only the UI Layers of the app and nothing else.</li>
</ul>
<h4 id="features-of-react"><strong>Features of React</strong></h4>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4053 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/features-of-react-1.jpg" alt="" width="507" height="453" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/features-of-react-1.jpg 507w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/features-of-react-1-300x268.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/03/features-of-react-1-390x348.jpg 390w" sizes="(max-width: 507px) 100vw, 507px" /></p>
<p>&nbsp;</p>
<h4 id="jsx"><strong>Jsx :</strong></h4>
<ul>
<li>JSX is a preferable choice for many web developers.</li>
<li>It makes the syntax just like HTML and is used to create React components by developers.</li>
<li>It is a syntax extension to JavaScript.</li>
<li>It is super easy for developers to write the building blocks.</li>
</ul>
<h4 id="virtual-dom">  <strong>Virtual DOM :</strong></h4>
<ul>
<li>In this object is a perfect description of the original DOM object</li>
<li>It will modify only that object in real DOM instead of updating whole objects.</li>
<li>It compares the difference between the new DOM and previous DOM representation.</li>
<li>It will reduces the time and cost taken for development.</li>
</ul>
<h4 id="performance"><strong>Performance :</strong></h4>
<ul>
<li>React divides the complex user interface into unique elements.</li>
<li>It increase the development time, multiple users can work on each element simultaneously.</li>
<li>It will perform efficiently.</li>
</ul>
<h4 id="one-way-data-binding"><strong>One-way Data binding :</strong></h4>
<ul>
<li>It provides good control throughout the application.</li>
<li>This gives better control over it.</li>
<li>It is designed to the extent that it can support One-way data binding or Unidirectional dataflow.</li>
</ul>
<h4 id="declarative-ui"><strong>Declarative UI :</strong></h4>
<ul>
<li>It is the best for creating engaging and interactive user interfaces for mobile.</li>
<li>It will generate a simple view for each state of the application</li>
<li>In this feature makes React code more readable and easier to fix bugs.</li>
</ul>
<h4 id="components"><strong>Components :</strong></h4>
<ul>
<li>Components are the heart and soul of React</li>
<li>The applications of ReactsJS are created with multiple components.</li>
<li>React JS components play a huge part in deciding the app visuals and interactions.</li>
<li>It is made up of several components.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/reactjs/what-is-react/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
