We know that components in React are used again and again in the UI, but we don’t normally render the same component with the same data. Sometimes we need to change the content inside a component. Props come to play in these cases, as they are passed into the component and the user. Let’s see how they work:
A simple component and then we passes the props as attributes and then access them inside our component using this.props. So props makes components reusable by giving components the ability to receive data from the parent component in the form of props. They are immutable.
- ReactJS | Props - Set 2
- ReactJS | Props - Set 1
- ReactJS | State in React
- ReactJS | Implementing State & Lifecycle
- CSS | animation-play-state Property
- ReactJS | Components
- ReactJS | Introduction to JSX
- ReactJS | Lists
- ReactJS | ReactDOM
- ReactJS | Refs
- ReactJS | Fragments
- ReactJS | PropTypes
- ReactJS | Using Babel
- ReactJS | Components - Set 2
- ReactJS | Virtual DOM
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.