import * as React from 'react'; import Swipeable = require('react-swipeable'); class SampleComponent extends React.PureComponent { private readonly handleSwiped: Swipeable.OnSwipedCallback = () => {}; private readonly handleSwiping: Swipeable.OnSwipingCallback = () => {}; private readonly handleSwipingUp: Swipeable.OnSwipingDirectionCallback = () => {}; private readonly handleSwipingRight: Swipeable.OnSwipingDirectionCallback = () => {}; private readonly handleSwipingDown: Swipeable.OnSwipingDirectionCallback = () => {}; private readonly handleSwipingLeft: Swipeable.OnSwipingDirectionCallback = () => {}; private readonly handleSwipedUp: Swipeable.OnSwipedDirectionCallback = () => {}; private readonly handleSwipedRight: Swipeable.OnSwipedDirectionCallback = () => {}; private readonly handleSwipedDown: Swipeable.OnSwipedDirectionCallback = () => {}; private readonly handleSwipedLeft: Swipeable.OnSwipedDirectionCallback = () => {}; private readonly handleTap: Swipeable.OnTapCallback = () => {}; private readonly handleClick = () => {}; private readonly swipeRef = React.createRef(); render() { return (
This element can be swiped
); } } class DivSwipeable extends Swipeable {} const TestComponent: React.StatelessComponent = (_) => { const handleSwiped = (event: React.TouchEvent) => {}; return (
this is sample code.
); };