Created
October 5, 2020 18:17
-
-
Save ShanikaNishadhi/1105dc12ba48635a379e1ec703579a2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
const ComponentOne = ({ children }) => { | |
return ( | |
<div> | |
<h5>This is the component one</h5>; | |
{ children } | |
</div> | |
); | |
} | |
const ComponentTwo = ({ children }) => { | |
return ( | |
<div> | |
<h5>This is the component two</h5>; | |
{children} | |
</div> | |
); | |
} | |
const ComponentThree = ({ children }) => { | |
return ( | |
<div> | |
<h5>This is the component three</h5> | |
{children} | |
</div> | |
); | |
} | |
const ComponentUsingProps = ({ content }) => { | |
return <h5>{content}</h5> | |
} | |
const App = () => { | |
const content = "Which component is using the content?"; | |
return ( | |
<div className="App"> | |
<ComponentOne> | |
<ComponentTwo> | |
<ComponentThree> | |
<ComponentUsingProps content={content} /> | |
</ComponentThree> | |
</ComponentTwo> | |
</ComponentOne> | |
</div> | |
); | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment