Skip to content

Instantly share code, notes, and snippets.

@ShanikaNishadhi
Created October 5, 2020 18:17
Show Gist options
  • Save ShanikaNishadhi/1105dc12ba48635a379e1ec703579a2b to your computer and use it in GitHub Desktop.
Save ShanikaNishadhi/1105dc12ba48635a379e1ec703579a2b to your computer and use it in GitHub Desktop.
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