score:2

Accepted answer

so from the link:

<lightbox
  images={[
    { src: '../images/photo-1.jpg' },
    { src: '../images/photo-2.jpg' }
  ]}
  isopen={this.state.lightboxisopen}
  onclickprev={this.gotoprevlightboximage}
  onclicknext={this.gotonextlightboximage}
  onclose={this.closelightbox}
/>

lightbox is the name of a react component. so you need to import it: import lightbox from 'react-images';

images, isopen, onclickprev, onclicknext, onclose are props for this components. these are special names defined by the component. brackets on the left hand side are indicating that you are writing javascript. {this.state.variable} makes reference to a component state, a state that you have to define in the component you are making (galery for example). {this.myfunction} points to a function called 'myfunction' on gallery. so you have to define those functions in your component.

this is just a snapshot. i dug a little bit and found a complete example on the github page of the project. here.

you can clone the repo and run this example locally. but i'd suggest you to use the create-react-app start a new app, and paste the code from the link (galery component) into your default app component, and try to make it work, and then tweak.

if none of this make sense to you, you probably have a mountain to climb called 'learning reactjs library'.

good luck.


Related Query

More Query from same tag