JedWatson / react-hammerjs

ReactJS / HammerJS integration. Support touch events in your React app.
MIT License
937 stars 129 forks source link

Please help: pinch events not firing #95

Open alexandraclaire opened 6 years ago

alexandraclaire commented 6 years ago

I am making a component with React and Hammer using react-hammer and I can't seem to get the pinch to work! I have successfully used the swipe events, but got stuck here.

This is the piece of code:

      <Hammer onPinch={this.onPinchStart.bind(this)} options={{
           recognizers: {
              pinch: {
                enable: true
              }
           }
        }}>
        <div className="investigate__panel--zoom">
          <p>PINCH TO ZOOM</p>
        </div>
      </Hammer>

and this is the event - I am just trying to get it to do ANYTHING at this point:

onPinchStart() { console.log('zooming!'); } Can anyone explain why this event is not being called?