Skip to content

Instantly share code, notes, and snippets.

@128keaton
Created September 15, 2017 18:21
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 128keaton/708cdc821d770eb85cb38b4262bf78fa to your computer and use it in GitHub Desktop.
Save 128keaton/708cdc821d770eb85cb38b4262bf78fa to your computer and use it in GitHub Desktop.
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