Overview - Props as read-only data
What is it?
In React, props are inputs passed from a parent component to a child component. They carry data or functions that the child can use to render UI or handle events. Props are read-only, meaning the child component cannot change them directly. This ensures a clear flow of data and predictable behavior.
Why it matters
Props being read-only prevents unexpected changes inside child components, which keeps the app stable and easier to debug. Without this rule, components could change shared data unpredictably, causing bugs and making the app hard to understand. It helps maintain a clear, one-way data flow from parent to child.
Where it fits
Before learning about props, you should understand React components and JSX basics. After mastering props as read-only, you can learn about state for managing data inside components and how to lift state up for shared data. This topic is foundational for building React apps with predictable data flow.