Skip to content

Instantly share code, notes, and snippets.

@jasurkurbanov
Last active July 22, 2020 07:30
Show Gist options
  • Save jasurkurbanov/0bef60723ef95fc6a29040ae4fed6a3a to your computer and use it in GitHub Desktop.
Save jasurkurbanov/0bef60723ef95fc6a29040ae4fed6a3a to your computer and use it in GitHub Desktop.
MyText-index.js 3
import * as React from 'react';
import { Text } from 'react-native';
const MyText = ({ h1, h2, h3, h4, h5, p, bold, italic, title, style, ...rest })=> {
return (
<Text style={[
h1 && { fontSize: 48 },
h2 && { fontSize: 32 },
h3 && { fontSize: 20 },
h4 && { fontSize: 18 },
h5 && { fontSize: 16 },
p && { fontSize: 12 },
bold && { fontWeight: 'bold' },
italic && { fontStyle: 'italic'},
style
]}{...rest}>{title}</Text>
);
};
export { MyText }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment