Olá, estou tendo problema de levar o styleshett para o compente BaseComponent esse e o link com o codigo completo Link github. codigo do componente com problema
interface MenuProps {
menuIsVisible: boolean;
}
const MenuIcon = styled(BaseComponent)<MenuProps>`
cursor: pointer;
position: relative;
z-index: 3;
`;
interface MenuHamburgerProps {
styleSheet?: StyleSheet;
menuIsVisible: boolean;
handleMenuIsVisible: () => void;
}
export const MenuHamburger = ({
menuIsVisible,
handleMenuIsVisible,
styleSheet,
}: MenuHamburgerProps) => {
return (
<MenuIcon
onClick={handleMenuIsVisible}
menuIsVisible={menuIsVisible}
styleSheet={styleSheet}
>
<div className="line-1"></div>
<div className="line-2"></div>
<div className="line-3"></div>
</MenuIcon>
);
};
Esse e o componete BaseComponent
interface StyledBaseComponentProps {
styleSheet?: StyleSheet;
ref: any;
}
const StyledBaseComponent = styled.div<StyledBaseComponentProps>`
display: flex;
flex-direction: column;
align-content: flex-start;
flex-shrink: 0;
${({ styleSheet }) => parseStyleSheet(styleSheet)}
`;
export interface BaseComponentProps {
styleSheet: StyleSheet;
[key: string]: any;
}
export const BaseComponent = React.forwardRef<unknown, BaseComponentProps>(
(props, ref) => {
return (
<StyleSheetManager shouldForwardProp={(prop) => prop !== 'styleSheet'}>
<StyledBaseComponent ref={ref} {...props} />
</StyleSheetManager>
);
},
);
BaseComponent.defaultProps = {
styleSheet: {},
};
Basicamente qualquer styleSheet que eu passe no MenuIcon com a prop styleSheet não e aplicado e chega no BaseComponent como vazio. Alguém poderia me horientar nesse problema.