react-native-actions-sheet
Version:
A Cross Platform(Android & iOS) ActionSheet with a robust and flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
22 lines (21 loc) • 1.12 kB
JavaScript
/* eslint-disable curly */
import React, { useImperativeHandle } from 'react';
import { ScrollView as RNGHScrollView } from 'react-native-gesture-handler';
import { useScrollHandlers } from '../hooks/use-scroll-handlers';
function $ScrollView(props, ref) {
var handlers = useScrollHandlers({
hasRefreshControl: !!props.refreshControl,
refreshControlBoundary: props.refreshControlGestureArea || 0.15,
});
useImperativeHandle(ref, function () { return handlers.ref.current; });
return (<RNGHScrollView {...props} ref={handlers.ref} simultaneousHandlers={handlers.simultaneousHandlers} scrollEventThrottle={handlers.scrollEventThrottle} onScroll={function (event) {
var _a;
handlers.onScroll(event);
(_a = props.onScroll) === null || _a === void 0 ? void 0 : _a.call(props, event);
}} onLayout={function (event) {
var _a;
handlers.onLayout();
(_a = props.onLayout) === null || _a === void 0 ? void 0 : _a.call(props, event);
}} bounces={false}/>);
}
export var ScrollView = React.forwardRef($ScrollView);