I need to pass props from wrapper to child component
Have a structure like this:
CabinetBlockContainer.jsx
smallChild.jsx
Right now my smallChild.jsx looks like:
return (
<CabinetBlockContainer>
<div className={props.className}>
<Typography variant="h6" color="primary">
{props.title}
</Typography>
<Typography variant="caption">{props.subtitle}</Typography>
</div>
<BalanceSmallBlock balance="1254.51" needIcon={props.needIcon} />
</CabinetBlockContainer>
);
and my container looks like:
return (
<div className={props.className}>
<div className="block-wrapper" >
</div>
</div>
);
})
I have many styles for my blocks, that's why I created wrapper(CabinetBlockContainer). I need to pass props from my CabinetBlockContainer to its child component. I don't really know is it the best practice, but seems normal.
I have tried to find in documentation how to pass props like this, but have any solution.