Skip to content

Commit

Permalink
feat: support custom scroll component
Browse files Browse the repository at this point in the history
  • Loading branch information
alpha0010 committed Apr 15, 2021
1 parent 99753eb commit 14d91c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Pdf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
NativeScrollEvent,
NativeSyntheticEvent,
RefreshControlProps,
ScrollViewProps,
StyleSheet,
View,
} from 'react-native';
Expand Down Expand Up @@ -84,6 +85,13 @@ type BaseListProps = {
*/
refreshControl?: React.ReactElement<RefreshControlProps>;

/**
* Render a custom scroll component, e.g. with a differently styled `RefreshControl`.
*/
renderScrollComponent?: (
props: ScrollViewProps
) => React.ReactElement<ScrollViewProps>;

/**
* This controls how often the scroll event will be fired while scrolling
* (in events per seconds). A higher number yields better accuracy for code
Expand Down Expand Up @@ -318,6 +326,7 @@ export const Pdf = forwardRef((props: PdfProps, ref: React.Ref<PdfRef>) => {
onScrollBeginDrag={props.onScrollBeginDrag}
onScrollEndDrag={props.onScrollEndDrag}
refreshControl={props.refreshControl}
renderScrollComponent={props.renderScrollComponent}
scrollEventThrottle={props.scrollEventThrottle}
testID="pdfFlatList"
/>
Expand Down

0 comments on commit 14d91c4

Please sign in to comment.