diff --git a/README.md b/README.md index 9896c07..68ed7aa 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ This is the list of exclusive props that are meant to be used to customise the b | `containerStyle` | no | `StyleProp` | Style to be applied to the container (Handle and Content) | | `friction` | no | `number` | Factor of resistance when the gesture is released. A value of 0 offers maximum * acceleration, whereas 1 acts as the opposite. Defaults to 0.95 | | `enableOverScroll` | yes | `boolean` | Allow drawer to be dragged beyond lowest snap point | - +| `customScrollComponent` | no | `ScrollView \| FlatList \| SectionList` | Custom instance of inner scroll element | ### Inherited Depending on the value of `componentType` chosen, the bottom sheet component will inherit its underlying props, being one of diff --git a/src/index.tsx b/src/index.tsx index a245deb..a098798 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -195,6 +195,10 @@ type CommonProps = { * Allow drawer to be dragged beyond lowest snap point */ enableOverScroll: boolean; + /* + * Custom inner scrolling component + */ + customScrollComponent: FlatList | ScrollView | SectionList; }; type TimingAnimationProps = { @@ -653,6 +657,10 @@ export class ScrollBottomSheet extends Component> { }; private getScrollComponent = () => { + if (this.props.customScrollComponent) { + return this.props.customScrollComponent; + } + switch (this.props.componentType) { case 'FlatList': return FlatList;