I'm trying to use PhotoSwipe in ReactJs component, and it doesn't work.
In sake of simplicity:
I've took all the html from here and put it into render in react component.
All the js i've put into ComponentDidMount
method.
I'm pushing on the image caption and getting Uncaught TypeError: undefined is not a function
on gallery.init();
All class
changed to className
as well as all itemScope, itemType, itemProp, tabIndex
What is wrong?
In react you have to build component before you can do 'ComponentDidMount'. So render your html in a react component. like this :
After that you can work with the something component.