Props — Just like we pass arguments in functions, we can pass in data to a component as props.

Why use Props?

Most people start React by building static pages (Always display the same thing). We want to be able to pass data from outside of the component and make the component dynamic.

Image for post
Image for post
  • The most important thing to understand about props is that they are immutable. In other words, props are read only data. You should not be trying to change the value of a prop. To make dynamic content that can change based on input, we will be exploring State.
  • Note that props is whatever that is passed to ReactDOM.render(). Also note that ReactDOM.render() can be in another file. So we can pass props from anywhere. …

About

Senal Kularatne

Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store