百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-point

> 编程语言
开源

React 的快速触摸事件

196 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

React 的快速触摸事件

react-point Travis npm package

react-point gives you fast touch events for your React applications.

A `` normalizes click and click-like touch events (not swipes or drags) into a "point" event. This helps you avoid the 300ms delay for click events on touch interfaces like iOS.

Installation

Using yarn:

$ yarn add react-point

Then, use as you would anything else:

javascript
// using ES6 modules
import PointTarget from 'react-point'

// using CommonJS modules
var PointTarget = require('react-point')

The UMD build is also available on unpkg:

xml

You can find the library on window.ReactPoint.

Usage

Just render a `` component and give it an onPoint function to call whenever the user clicks or taps the element.

javascript
import React from 'react'
import PointTarget from 'react-point'

class App extends React.Component {
  handlePoint = () => {
    alert('I was clicked or tapped!')
  }

  render() {
    return (
      
    )
  }
}

By default, a renders a for accessibility. However, you can use the children prop to make it render something else. For example, to render a `

)

} }


*Note:* The `onClick`, `onTouchStart`, `onTouchMove`, `onTouchEnd`, and `onTouchCancel` props will be overwritten because `` needs them to do its thing).

## About

react-point is developed and maintained by [React Training](https://reacttraining.com). If you're interested in learning more about what React can do for your company, please [get in touch](mailto:[email protected])!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言