import * as React from 'react' import { NavigationScreenConfigProps } from 'react-navigation' import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native' import { CollapsibleHeaderFlatList } from 'react-native-collapsible-header-views' import { getStatusBarHeight } from 'react-native-iphone-x-helper' const Header = ({ goBack }: { goBack: () => void }) => ( {'<-'} WRAPPED INSTANCE METHODS ) export const WrappedInstanceMethods = ({ navigation }: NavigationScreenConfigProps) => { const ref: React.RefObject> = React.createRef() const scrollToTop = () => { if (ref.current && ref.current.animatedComponent()) { ref.current.animatedComponent() ._component._listRef._scrollRef.scrollTo({ y: 0, animated: true }) } } const scrollToBottom = () => { if (ref.current && ref.current.animatedComponent()) { ref.current.animatedComponent() ._component._listRef._scrollRef.scrollToEnd({ animated: true }) } } const Item = ({ item }: { item: number }) => ( {`Scroll to ${item % 2 ? 'top' : 'bottom'}`} ) return ( <>