v7 migration guide
🚧 Major Changes / Breaking Changes 🚧​
- we have dropped support for
es5transpiled output- we target
es2015for our transpilation nowswipeableutilizes object/array spread & const/let natively
- we target
preventScrollOnSwipe- "new" prop. ReplacespreventDefaultTouchmoveEvent- same functionality but renamed to be more explicit on its intended use
- fixed bug - where toggling this prop did not re-attach event listeners
- update - we now only change the
passiveevent listener option fortouchmovedepending on this prop- see notes in api docs for more details on passive-listener
Typescript changes​
- Added a ton of comments to the types that should now show up in IDEs.
Migrate Swipeable v6 to v7​
If you you're currently utilizing preventDefaultTouchmoveEvent you should be able to simply replace its usage with preventScrollOnSwipe.
const handlers = useSwipeable({
- preventDefaultTouchmoveEvent: true,
+ preventScrollOnSwipe: true,
});