Skip to content

Instantly share code, notes, and snippets.

@nabinkumarn
Last active April 29, 2019 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabinkumarn/f671d926632ceda06f22a084069dc9f6 to your computer and use it in GitHub Desktop.
Save nabinkumarn/f671d926632ceda06f22a084069dc9f6 to your computer and use it in GitHub Desktop.
React native MyText Component
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