I am making a generalized version of a styled component to replace duplicated code in my codebase. The component looks something like this:
const CustomDiv = styled.div`
display:flex;
b {
padding-right:5px
}
`;
const DivWrapper = ({style, children}) => {
return (
<CustomDiv style={style}>
{children}
</CustomDiv>
);
};
I want to be use this "DivWrapper" in other places of the code base but be able to change the b padding in other places when using it. I tried extending it like this:
const SuperCustomDiv = styled(CustomDiv)`
b {
padding-right:10px
}
`;
I am using the styled components library for React.