is it best to have styles in react native code example
Example 1: react native styles for both platforms
import { Platform, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red'
},
android: {
backgroundColor: 'green'
},
default: {
backgroundColor: 'blue'
}
})
}
});
Example 2: styles in react native
import { StyleSheet} from 'react-native';
<View style={styles.container}>
</View>
const styles = StyleSheet.create({
container: {
marginTop: 50,
},
});