Open lzl124631x opened 7 years ago
@lzl124631x Use ref
callback.
import React from 'react';
import ReactDOM from 'react-dom';
import Hammer from 'react-hammerjs';
let hammerComponent;
const onSwipe = () => {
hammerComponent.hammer.stop();
};
const App = () => (
<Hammer onSwipe={onSwipe} ref={(instance) => { hammerComponent = instance; }}>
<div>Foo</div>
</Hammer>
);
ReactDOM.render(<App />, document.getElementById('root'));
I want to stop the current session.