If you're new to React, state and props can feel confusing. Here's the short version:
State = data a component owns and can change
Props = data a component receives from its parent (read-only)
State example:
function Counter() {
const [count, setCount] = useState(0);
return (
setCount(count + 1)}>
Clicked {count} times
);
}
Props example:
function Greeting({ name }) {
return
Hello, {name}!
;}
function App() {
return ;
}
Rule of thumb: if the component needs to change the data itself, use state. If the data comes from a parent, it's a prop.
I made a full 10-minute beginner walkthrough with more examples:
What confused you most when learning state vs props? Let me know in the comments.

![Why Object.keys(user) Returns string[], Not (keyof User)[]: TypeScript Means It](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2q4w48b9bzs43tynyhsf.png)