What are component properties?
Properties are used to pass data into your React components. Instead of calling a method with new state as the argument value, properties are passed only when the component is rendered. That is, we pass property values to JSX elements.
Note
In the context of JSX, properties are called attributes, probably because that's what they're called in XML parlance. In this book, properties and attributes are synonymous with one another.
Properties are different than state because they're not something that's changed after the initial render of the component. If a property value has changed, and we want to re-render the component, then we have to re-render the JSX that was used to render it in the first place. The React internals ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access