Is there a way in React Native that I can put all of my styles in a single file so it can easily be maintained (from my perspective) like in HTML we have a .css
fil
According to ECMAScript 6, correct way to export your styles would be like this.
style.js
import {StyleSheet} from 'react-native'
export default StyleSheet.create({
container: {
flex: 1,
marginTop: 20
},
welcome: {
textAlign: 'center'
}
});
Then in your main JS file you can import like this.
import styles from './style'