Props are inputs a component receives from its parent, and state is data a component owns and changes itself. Props flow down and are read-only, while state is the component's own memory.
Props
State
Read-only
Mutable
Passed from parent
Local to component
Cannot be changed by component
Can be changed by component
External data
Internal data
Functional parameters
Component memory
A component can't change its own props. When the parent passes new props, the component re-renders with them. State changes through the component's setter, like setCount, and each change also triggers a re-render. The two often meet, because a parent's state becomes a child's props.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Saved in this browser - sign in to keep your review list.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Keep going - a few more words and AI can grade it.
Interview lens
How interviewers actually use this question
Likely follow-ups
What goes wrong if you change a state object directly instead of calling the setter?React compares the old and new value by reference, so an in-place change can skip the re-render. Build a new object or array and pass that to the setter.
Two sibling components need the same data. Where should that state live?In their closest common parent, passed down to both as props. Name the cost: more props to pass down, and each change re-renders that parent's subtree.
Is it a good idea to copy a prop into state with useState(props.value)?The copy only takes the first value, so later prop changes are ignored. A strong answer says compute from the prop during render, or reset with a key.
Right after calling setCount(count + 1), what does logging count print, and why?It still prints the old value. State is a snapshot per render; use the updater form setCount(c => c + 1) when the next value depends on the last.
What you can say
Props are the inputs a component gets from its parent, and state is data the component owns and changes itself.
Props flow down and are read-only. A component can't change its own props, and when the parent passes new ones, it re-renders with them.
State is the component's own memory. It changes through its setter, like setCount, and each change also triggers a re-render.
The two often meet, because a parent's state often becomes a child's props, like a count the parent owns and passes down for a child to display.
The limit is that a child can never edit what it receives, so when I design a component I first ask who owns each piece of data, because only the owner can change it.
Weak answers to avoid
Says state is mutable, so you just change itChanging a state object in place can skip the re-render. Say state changes only through its setter, with a new value each time.
Treats props and state as unrelatedThey connect all the time, since a parent's state often becomes a child's props. Show that flow, or the answer sounds like a memorized table.
Copies props into state by defaultuseState only reads its initial value once, so the copy goes stale when the parent sends new props. Read the prop directly instead.
Recites the table with no exampleA list of adjectives doesn't show understanding. Walk one case, like a count in the parent passed down, and say what re-renders when it changes.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.