Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-point
Advanced tools
react-point
gives you fast touch events for your React applications.
A <PointTarget>
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.
Using yarn:
$ yarn add react-point
Then, use as you would anything else:
// using ES6 modules
import PointTarget from 'react-point'
// using CommonJS modules
var PointTarget = require('react-point')
The UMD build is also available on unpkg:
<script src="https://unpkg.com/react-point/umd/react-point.min.js"></script>
You can find the library on window.ReactPoint
.
Just render a <PointTarget>
component and give it an onPoint
function to call whenever the user clicks or taps the element.
import React from 'react'
import PointTarget from 'react-point'
class App extends React.Component {
handlePoint = () => {
alert('I was clicked or tapped!')
}
render() {
return (
<PointTarget onPoint={this.handlePoint}/>
)
}
}
By default, a <PointTarget>
renders a <button>
for accessibility. However, you can use the children
prop to make it render something else. For example, to render a <div>
:
import React from 'react'
import PointTarget from 'react-point'
class App extends React.Component {
handlePoint = () => {
alert('I was clicked or tapped!')
}
render() {
return (
<PointTarget onPoint={this.handlePoint}>
<div>Click or tap here</div>
</PointTarget>
)
}
}
Note: The onClick
, onTouchStart
, onTouchMove
, onTouchEnd
, and onTouchCancel
props will be overwritten because <PointTarget>
needs them to do its thing).
Enjoy!
react-point is developed and maintained by React Training. If you're interested in learning more about what React can do for your company, please get in touch! "hat's it :) Enjoy!
FAQs
Fast touch events for React
The npm package react-point receives a total of 1,509 weekly downloads. As such, react-point popularity was classified as popular.
We found that react-point demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.