juniorReact
What is the difference between state and props?
Updated Apr 23, 2026
Short answer
Short Answer
In React:
- State is data managed inside a component that can change over time.
- Props are data passed from a parent component to a child component and are read-only.
In simple terms:
State = internal, mutable data Props = external, read-only data
Deep explanation
Deep Explanation
What is State?
State represents data that belongs to a component and can change during its lifecycle.
Example:
JSX
import { useState } from "react";
function Counter() { const [count, setCount] = useState(0);
return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> );}Key points:
- Managed inside the component
- Can be updated using
setState/useState - Triggers re-render when changed
---
What are Props?…
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro