require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_htmlconst MyText = ({ h1, h2, h3, h4, h5, p, bold, italic, title, style, ...rest })=> {
Marked text
This text will be italic this text will be bold
return (
| import * as React from 'react'; | |
| import { Text, View, StyleSheet } from 'react-native'; | |
| export default function App() { | |
| return ( | |
| <View style={styles.container}> | |
| <Text style={styles.h1}>Heading 1</Text> | |
| <Text style={styles.h2}>Heading 2</Text> | |
| <Text style={styles.h3}>Heading 3</Text> | |
| <Text style={styles.h4}>Heading 4</Text> |
| expo init MyApp | |
| cd MyApp | |
| expo start # you can also use: npm start |
| import * as React from 'react'; | |
| import { Text } from 'react-native'; | |
| const MyText = ()=> { | |
| return ( | |
| <Text>Custom Component</Text> | |
| ); | |
| }; | |
| export { MyText } |
| 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>{title}</Text> | |
| ); | |
| }; | |
| export { MyText } |
| 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 }, |
| import React from 'react'; | |
| import { StyleSheet, View } from 'react-native'; | |
| import { MyText } from './src/components/MyText' | |
| export default function App() { | |
| return ( | |
| <View style={styles.container}> | |
| <MyText title={'Header 1'} h1/> | |
| <MyText title={'Header 1'} h2/> |
| import { PixelRatio, Dimensions} from 'react-native'; | |
| const pixelRatio = PixelRatio.get(); | |
| const deviceHeight = Dimensions.get('window').height; | |
| const deviceWidth = Dimensions.get('window').width; | |
| const adjust = (size) => { | |
| if (pixelRatio >= 2 && pixelRatio < 3) { | |
| // iphone 5s and older Androids |
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_htmlconst MyText = ({ h1, h2, h3, h4, h5, p, bold, italic, title, style, ...rest })=> {
Marked text
This text will be italic this text will be bold
return (
import * as React from 'react'; import { Text } from 'react-native'; import adjust from "../../adjust";
const MyText = ({ h1, h2, h3, h4, h5, p, bold, italic, title, style, ...rest })=> { return ( <Text style={[ h1 && { fontSize: adjust(48) }, h2 && { fontSize: adjust(32) }, h3 && { fontSize: adjust(20) },