O'Reilly logo

React and React Native by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required