ScrollView
s with react-native-web
let mobile devices drag to scroll, and let you use your mac trackpad on desktop.
For horizontal scrollable content, such as carousels, I often find myself wanting to drag with my mouse.
This gist provides a simple hook that makes your ScrollView
draggable with a mouse.
It hasn't been tested with pagingEnabled
on FlatList
s, but it should work for normal a FlatList
on web.
Here's an example video.
This won't work with react@17
because it uses findNodeHandle
. Maybe try it without that and see if it still works? I haven't tried yet.
I am seeing the same typing issue as well as this error:
TS2559: Type '{ children: (false | Element)[]; }' has no properties in common with type 'IntrinsicAttributes & ScrollViewProps & RefAttributes '.
Can you post an example of how you applied this?