Created
September 15, 2017 18:21
-
-
Save 128keaton/708cdc821d770eb85cb38b4262bf78fa to your computer and use it in GitHub Desktop.
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
class SampleImage extends React.Component { | |
render() { | |
let pic = { | |
uri: "http://lorempixel.com/" + this.props.width + "/" + this.props.height | |
}; | |
let imageWidth = Number.parseInt(this.props.width, 10) | |
let imageHeight = Number.parseInt(this.props.height, 10) | |
return (<Image | |
source={pic} | |
style={{ | |
width: imageWidth, | |
height: imageHeight | |
}}/>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment