ReactQuestion 13 of 28
Difference between props and state?
Answer out loud or in your head first, then compare.
Answer
Props:
JSX
<User name="Tom" />come from outside.
State:
JavaScript
const [name, setName] =
useState("");is managed by the component.
Remember:
props → the component's input
state → its changing dataHow did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- C-P02 · How do props and state differ? — React, Next.js and frontend