Skip to main content

Command Palette

Search for a command to run...

Sending data from component to another in ReactJS

Updated
1 min readView as Markdown
Sending data from component to another in ReactJS

how can we send or transmit data from a react component to another ? this is a very popular asked question while coding and the answer is : Sending data from component to another is very easy , it depends on what we called "props". how does it work ? For passing the data from the child component to the parent component, we have to create a callback function in the parent component and then pass the callback function to the child component as a prop. This callback function will retrieve the data from the child component. The child component calls the parent callback function using props and passes the data to the parent component.

More from this blog

Omar's blog

135 posts