In React Native, I am looking to modify a specific style within a sub-component. For instance, I have defined a style called CircleShapeView
:
const styles = StyleSheet.create({
CircleShapeView: {
width: 50,
height: 50,
borderRadius: 50/2,
backgroundColor: '#000'
},
});
Now, I want to change the backgroundColor
when using this style. Is there a way to accomplish this, such as:
<Image
style={backgroundColor: "#fff", ...styles.CircleShapeView}
...
/>
What is the correct approach to achieve this?