In React Native, you can have a separate file for styling and access that file from other pages to refer to the stylings.
'use strict';
var React = require('react-native');
const Dimensions = require('Dimensions');
var {
StyleSheet,
} = React;
var styles = StyleSheet.create({
defaultBackground: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#ffffff',
},
menuButton: {
fontSize: 22,
color: '#ffffff',
paddingHorizontal: 20,
},
container: {
flex: 1
}
});
module.exports = styles;
Here this is acquired by "StyleSheet" of React.
Say for a sample like following,
myName: 'Username',
myURL: 'www.google.com',
reactNativeUser: true,
age: 22,
Something like this to be used in a separate file as a property file and to be used across the application.
How to achieve this?