Skip to content

Instantly share code, notes, and snippets.

@andrisgauracs
Last active December 30, 2018 22:01
Show Gist options
  • Select an option

  • Save andrisgauracs/988a31fc495ece2aee5fc7fe6dd32966 to your computer and use it in GitHub Desktop.

Select an option

Save andrisgauracs/988a31fc495ece2aee5fc7fe6dd32966 to your computer and use it in GitHub Desktop.
Getting random images from picsum.photos
const files = [];
for (let i = 0; i < 20; i++) {
let pictureNr = Math.floor(Math.random() * 100);
files.push({
large: `https://picsum.photos/1920/1080/?image=${pictureNr}`,
small: `https://picsum.photos/200/113/?image=${pictureNr}`
})
}
this.state = {
images: files
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment