import type React from 'react'; import type { FlatListProps, StyleProp, ViewStyle } from 'react-native'; import { FlatList, StyleSheet } from 'react-native'; export type PageScrollViewProps = Omit, 'ListFooterComponentStyle' | 'ListFooterComponent' | 'data' | 'renderItem' | 'style' | 'keyExtractor' > & { /** Use this to change the backgroundColor. Internally, it changes FlatList's `style` and `ListFooterComponentStyle`. * * We change `style` to have backgroundColor when iOS users overscroll with `bounces`. */ backgroundColor?: string; /** The style of the View that wraps your children. Use this for styles such as paddings. */ // Here just to improve the default comment. style?: StyleProp; children?: React.ReactNode; }; export function PageScrollView({ backgroundColor, contentContainerStyle, children, style, ...rest }: PageScrollViewProps): JSX.Element { return ( {children}} overScrollMode='never' keyboardShouldPersistTaps='handled' nestedScrollEnabled {...rest} renderItem={null} data={[]} /> ); } const styles = StyleSheet.create({ container: { flexGrow: 1, }, style: { flex: 1, }, });