I'm trying to make sure my custom parent components can have access to any children inside of them. I am trying to accomplish a setup similar to:
function App() {
return (
<div className="App">
<Parent>
<img src={spaceGasImg} height='100px' width='100px'></img>
</Parent>
</div>
);
}
I'd like to be able to get the data from my img tag into my parent and potentially even be able to remove the img tag from the parent on a hook. I'm not sure if this is best handled by using higher order components?
Is there a way to setup my parent component such that it assumes anything wrapped inside of it is a child and can read all the data of that child?
any advice on laying out how this relationship should work is greatly appreciated :)