diff options
Diffstat (limited to 'src/view/com/pager/DraggableScrollView.tsx')
-rw-r--r-- | src/view/com/pager/DraggableScrollView.tsx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/view/com/pager/DraggableScrollView.tsx b/src/view/com/pager/DraggableScrollView.tsx new file mode 100644 index 000000000..4b7396eaa --- /dev/null +++ b/src/view/com/pager/DraggableScrollView.tsx @@ -0,0 +1,15 @@ +import {useDraggableScroll} from 'lib/hooks/useDraggableScrollView' +import React, {ComponentProps} from 'react' +import {ScrollView} from 'react-native' + +export const DraggableScrollView = React.forwardRef< + ScrollView, + ComponentProps<typeof ScrollView> +>(function DraggableScrollView(props, ref) { + const {refs} = useDraggableScroll<ScrollView>({ + outerRef: ref, + cursor: 'grab', // optional, default + }) + + return <ScrollView ref={refs} horizontal {...props} /> +}) |