node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

react-touch-mixin

React Touch Mixin

Mixin to enable touch interactions in React components.

Usage

// myComponent.js 
var react = require('react');
var touchMixin = require('react-touch-mixin');
 
module.exports = react.createClass({
  mixins: [touchMixin],
  render: function () {
    /* ... */
  }
});
 
// application.js 
var react = require('react');
var myComponent = require('./myComponent');
 
react.render(myComponent({
  onTap: function () {
    console.log('You tapped!');
  }
}), someDOMNode);
 

Note: Currently only the “tap” event is supported.