Open mjbarton712 opened 1 year ago
I would love to, if possible, create a shared globalStyles.js file so that we can reuse basic styles.
// globalStyles.js import { StyleSheet } from 'react-native'; export const textStyles = StyleSheet.create({ regularText: { fontFamily: 'Baloo-Regular', fontSize: 16, // Add other styling properties here. }, // Add more text styles as needed. });
Then in whatever JS component we have we can import that and use it in elements to eliminate duplicated code.
// MyComponent.js import React from 'react'; import { View, Text } from 'react-native'; import { textStyles } from './globalStyles'; const MyComponent = () => { return ( <View> <Text style={textStyles.regularText}>This text uses Baloo-Regular</Text> </View> ); }; export default MyComponent;
Mainly I just want to get rid of the excess duplication for similar styles like where font size, font, and color are the only differentiations
I would love to, if possible, create a shared globalStyles.js file so that we can reuse basic styles.
Then in whatever JS component we have we can import that and use it in elements to eliminate duplicated code.