Props in React
React allows us to pass information to a Component using something called props (which stands for properties). Props are objects which can be used inside a component. 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..
ReactJS State vs Props
In React props are a way to pass the data or properties from parent component to child components while the state is the real-time data available to use within that only component.
States and props are two of the most important concepts of React and everything in React is based upon them. But before jumping into State and Props we need to know about the relation between components and normal functions.
Table of Content
- Relation between Components and normal functions in JavaScript
- State in React
- Props in React
- Difference between props and state