Skip to content

2 things... #5

Description

@KjellConnelly

Situation 1: I only want to have the theme affect part of the style... for instance, I create a component with specific styles. But I want the backgroundColor to be based off the theme. The rest of the styles, I want to keep defined in the component as inline styles. I couldn't do

// import {styles} from react-native-theme
<View style={{color:"brown", margin:4, width:300, ...styles.red}} /> 

Situation 2: Situations where I define styles in props. For example, the Button component in react-native like this:

// import {styles} from react-native-theme
<Button color="red" title="Click Me" /> // works

<Button color={styles.red} title="Click Me" /> // doesn't works
<Button style={{color:"red"}} title="Click Me" /> // doesn't work
<Button style={styles.red} title="Click Me" /> // doesn't work

It seems like with react-native-theme, it only works with style. Is there a workaround?

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