Last active
April 29, 2019 10:33
-
-
Save nabinkumarn/f671d926632ceda06f22a084069dc9f6 to your computer and use it in GitHub Desktop.
React native MyText Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Text, StyleSheet } from 'react-native'; | |
const styles = StyleSheet.create({ | |
customDefaultFont: { | |
fontFamily: 'Lato-Regular' | |
} | |
}); | |
const MyText = ({ | |
style, children, fontFamily, ...otherProps | |
}) => ( | |
<Text style={[style, fontFamily ? { fontFamily } : styles.customDefaultFont]} {...otherProps}> | |
{children} | |
</Text> | |
); | |
export default MyText; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment