Skip to content

tintColor and experimental_backgroundImage not updating when changing theme #1030

@oblador

Description

@oblador

What happened?

On <Image /> elements tintColor is both a style and a prop, but it doesn't update when theme is changed, it keeps the old value.

On <View /> elements in new architecture for quite a while a experimental_backgroundImage style prop has been supported to do stuff like gradients, but when theme is changed this effect disappears completely.

Steps to Reproduce

<Image style={styles.image} source={...} />
<View style={styles.view} />


const styles = StyleSheet.create((theme) => ({
  image: {
    tintColor: theme.color.primary,
  },
  view: {
    aspectRatio: 1,
    experimental_backgroundImage: `linear-gradient(180deg, ${theme.color.primary} 50%, ${theme.color.secondary} 100%)`,
  },
}));

Snack or Repository Link (Optional)

No response

Unistyles Version

3.0.17

React Native Version

0.81.5

Platforms

iOS

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions