AceDevHub
Beginner React Interview QuestionsBeginnerComparison

React · Question 8

What is the difference between props and state in React?

Direct answer

Props are inputs supplied by a parent, while state is component memory managed by React and updated by the component through state setters.

FeaturePropsState
SourceUsually parent componentComponent using a state Hook
Mutated directly?NoNo; use the state setter
PurposeConfigure a componentRemember changing information
Can trigger a render?New props arrive during parent-driven renderingA state update can schedule a render

Both props and state should be treated as immutable snapshots for a particular render.