mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
18 lines
444 B
TypeScript
18 lines
444 B
TypeScript
import * as React from 'react';
|
|
import Hammer from 'react-hammerjs';
|
|
|
|
class ReactHammer extends React.Component<Hammer.ReactHammerProps> {
|
|
swipe: Hammer.ReactHammerProps['onSwipe'] = input => {
|
|
console.log(input.deltaX);
|
|
}
|
|
|
|
render() {
|
|
const { children, ...props } = this.props;
|
|
return (
|
|
<Hammer onSwipe={this.swipe} {...props}>
|
|
{children}
|
|
</Hammer>
|
|
);
|
|
}
|
|
}
|