Created
May 14, 2018 20:41
-
-
Save anghelalexandra/b9fa76e87ece8fdc3d96f100216c438e to your computer and use it in GitHub Desktop.
iOS and Android apps with React Native - React Native 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 { View, Text, Image } from 'react-native'; | |
import PropTypes from 'prop-types'; | |
import styles from './styles'; | |
class ExampleRNComponent extends React.Component { | |
render() { | |
return ( | |
<View style={styles.w100}> | |
<View style={styles.menuTitleWrap}> | |
<Image | |
source={this.props.url} | |
style={styles.shadowImage} | |
/> | |
</View> | |
<Text>{this.props.title}</Text> | |
</View> | |
); | |
} | |
} | |
ExampleRNComponent.propTypes = { | |
url: PropTypes.string.isRequired, | |
title: PropTypes.string.isRequired, | |
}; | |
export default ExampleRNComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment