In plain words
A component is a reusable piece of screen, like a post card or a button, and props are the values you hand it each time you use it.
Where you see it
Chirp's feed shows fifty posts, but there is only one PostCard file. The feed uses it fifty times, handing each copy a different author, text and like count, written like an HTML tag with a capital letter: <PostCard author="maya" />.
What goes wrong
- Three near-copies of the same component
Ask for a profile page and you may get PostCard, PostCard2 and ProfilePostCard, all nearly identical. Fix a bug in the first and the other two keep it.
- Changing a prop inside the component
Props flow one way, from parent to child, and React treats them as read-only. To change a value, the child calls a function the parent passed down, such as onLike.
props.likes = props.likes + 1; - Passing one value through five layers
When a prop travels through components that never use it, one careless edit breaks the chain. Developers call this prop drilling, and it usually means the value needs a shared home.
What to tell your agent
Quick check
Sign in to earn +10 XP for itYou make the author's name bold in Chirp's PostCard file. What changes on the feed?