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 1
- ReactJS | Props - Set 2
- ReactJS | State in React
- ReactJS | Implementing State & Lifecycle
- ReactJS | Refs
- ReactJS | Keys
- ReactJS | Using Babel
- ReactJS | Lists
- ReactJS | Fragments
- ReactJS | Components - Set 2
- ReactJS | Components
- ReactJS | ReactDOM
- ReactJS | Introduction to JSX
- ReactJS | Virtual DOM
- Difference between ReactJS and Vue.js
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.