0

I have a component which I export from a helper file:

export const BaseStyle = styled.Text`
    color: ${({ theme }) => theme.colors.gray900};
    font-size: 36px;
    line-height: 40px;
`;

And I am trying to create another styled component which wraps a third party component, but also applies all the styles from BaseStyle

const FinalComponent = styled(thirdPartyComponent)`
    background-color: red;
    //My goal is to spread the styles of BaseStyle here somehow
`;

Is this achievable in React Native?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Onyx
  • 5,186
  • 8
  • 39
  • 86
  • @possum No as styled components is not used in the suggested thread and I am asking a styled components related question. – Onyx Apr 11 '23 at 14:06
  • You could extract out common css with styled.css``. and then use it in BaseStyle as well as your FinalComponent. – CodeThing Apr 11 '23 at 14:11

0 Answers0