React Props and Sate
In react, components are responsible for generating HTML. To make HTML generate dynamically we need to pass data to our component so that our component can use variables and serve dynamic HTML. There are two types of data in react state (private data available in component only) props (public data can be passed to component from outside)
What are props in React?
What is the state in react?
React components has a built-in state object which is private to a component. State can not be accessed from outside of the class. However, it can be passed as an argument to another component. Whenever the state is changed component calls the render function to render HTML elements.