Closed joki20 closed 2 years ago
@joki20 I'd recommend taking a look at the examples a bit more and seeing how they are utilizing useSwipeable
.
In your provided example it would look something more like this
import React from 'react';
import { useSwipeable } from 'react-swipeable';
import './App.css';
function App() {
const handlers = useSwipeable({
onSwiped: (e) => console.log("User Swiped!", e)
})
return (
<div {...handlers} className="App">
</div>
);
}
export default App;
Beginner question: I am trying to place hooks in a separate folder src/Hooks but I have problem in using react-swipeable doing so. This is what I have right now, but nothing is happening.
src/Hooks/useSwipeable.tsx
App.tsx
Would love to achieve this, but don't know what is wrong?