neptunian / react-photo-gallery

React Photo Gallery
http://neptunian.github.io/react-photo-gallery/
Other
1.97k stars 310 forks source link

How exactly is this implemented? #164

Open MotorCityCobra opened 4 years ago

MotorCityCobra commented 4 years ago

import Gallery from "react-photo-gallery"

and

Gallery photos={photos} in the jsx?

?

Why not show how this works in an entire component like everyone else does with their npm packages? I don't get any images displayed after trying many combinations.

KennyHammerlund commented 4 years ago
const photos = [
  {
    src: 'http://example.com/example/img1.jpg',
    width: 4,
    height: 3
  },
  {
    src: 'http://example.com/example/img2.jpg',
    width: 1,
    height: 1
  }
];

<Gallery photos={photos} />;

seems pretty straight forward?

TayyabNaveed commented 4 years ago

Add require like such { src: require("./images/1.jpg"), width: 1863, height: 1000 },