Skip to content

Styles in CustomButton are overriding CustomText variants #67

@marianozicavo

Description

@marianozicavo

I have a green variant in CustomText that sets {color: 'green'}. I want to use this variant in a CustomButton to change the text color.

<CustomButton green/>

The problem is that the default styles.text that CustomButton is passing to CustomText is overwriting all variants inside CustomText. This happens with every style field defined in styles.text as they have more priority than the text variants. This isn't a big problem with the color, but in some cases like fontSize it implicates redefining things you have already defined in the CustomText.

Definition of CustomText:

<Text {...this.props.textProps} style={[styles.base, this.customStyles(), this.props.style]}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions