22
loading...
This website collects cookies to deliver better user experience
<a href = "/home" />
return (
<div>
<h1>I am the parent component</h1>
<ChildComp />
</div>
)
function ChildComp() {
return (
<div>
<h2>I will receive data from my parent soon</h2>
</div>
)
}
return (
<div>
<h1>I am the parent component</h1>
<ChildComp />
<ChildComp />
<ChildComp />
</div>
)
<a href="www.twitter.com">Click and start tweeting</a>
<ChildComp attribute = {value} />
return (
<div>
<h1>I am the parent component</h1>
<ChildComp passion = {'I love Coding to the fullest'} />
</div>
)
Lets see how we can receive such data in our child component
function ChildComp( props ) {
return (
<div>
<h2>{props.passion}</h2>
</div>
)
}
return (
<div>
<h1>I am the parent component</h1>
<ChildComp name = "Alex" proffession = "Software Enginner" />
</div>
)