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

<channel>
	<title>what is stats and props in react - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/what-is-stats-and-props-in-react/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-stats-and-props-in-react/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Tue, 29 Mar 2022 12:15:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>what is stats and props in react - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-stats-and-props-in-react/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 fetchpriority="high" 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 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>
	</channel>
</rss>
