Styling component with CSS Class

You can pass multiple styling objects on a component like you will do in the HTML world with multiple CSS classes. On the style props pass an array of objects.

<View style={[style.container, styles.banner]}>
<Text>StarPort</Text>
</View>

const styles = StyleSheet.create({
container: {
flex: 1,
},
banner: {
backgroundColor: 'purple',
padding: 20,
},
});
Subscribe?

Be the first to receive insightful articles and actionable resources that help you to elevate your skills.