How to pass props from a parent component down to a child in React

Owen Abbott
1 min readSep 13, 2020

--

When passing a prop from a parent component to a child in react, think of it as declaring a new variable with the same definition as the one you described in the state.

for example, if you have a state object called DogName: “Fido”, and you have a child component named Dog, you can write DogName = DogName as a property of the child component where you render it.

The convention is to use the same name as you use in the State, but it doesn’t have to be. You could write Anything = DogName, and it would have the same result. The property’s name is just the variable’s name, and it’s referencing the object in the parent’s state.

--

--

No responses yet