t-kelly / react-tap-event-plugin

Instant TapEvents for React

Home Page:http://facebook.github.io/react/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

You've probably heard of iOS's dreaded 300ms tap delay. React's onClick attribute falls prey to it. Facebook's working on a solution in the form of TapEventPlugin, but it won't be made available until 1.0.

If you're reading this, you're probably working on a project that can't wait until they figure out how they want to publish it. This repo is for you.

When Facebook solves #436 and #1170, this repo will disappear.

Usage

var injectTapEventPlugin = require("react-tap-event-plugin");
injectTapEventPlugin();

Example

var React = require('react'),
injectTapEventPlugin = require("react-tap-event-plugin");
injectTapEventPlugin();

var Main = React.createClass({
  render: function() {
    return <button onTouchTap={this._handleTouchTap}>Tap Me</button>
  },

  _handleTouchTap: function() {
    alert('Tap');
  }
});

React.render(<Main />, document.body);

About

Instant TapEvents for React

http://facebook.github.io/react/


Languages

Language:JavaScript 100.0%