Passing Props From Child to Parent Component in React.js

Tom Nagle
2 min readAug 1, 2021

Technically it’s not possible to pass props up to a parent in the same way you pass props down to a child. However, this article is going to propose two methods you can use that may help you solve the problem that bought you to this article.

The first method is something you probably do all the time. The second method is more realistic and may change the way you think about React components.

Method #1 — Pass a function down to change the prop

In this method, you store the property in the parent component and pass down a function that allows the child to update the prop stored in the parent component.

In the above code, we create state with count and a function called setCount that updates count. setCount is then…

--

--

Tom Nagle

I am a full stack JavaScript developer, living in Melbourne, Australia. My preferred stack is Mongoose, TypeScript, Node.js, React & GraphQL.