I'm trying to access the scrollToIndex() method or scrollToItem() method from FlatList using the useRef hook in a functional component. I want to be able to use flatListRef.current.ScrollToIndex() in my component, similar to the way a class-based component uses this.flatListRef.ScrollToIndex():
const flatListRef = useRef(React.createRef)
<FlatList
data={items}
renderItem={({ item }) => <Item item={item} />}
keyExtractor={item => item.id.toString()}
contentContainerStyle={styles.card}
horizontal={true}
showsHorizontalScrollIndicator={false}
ref={flatListRef}
/>
console.logging flatListRef.current doesn't show the aforementioned methods I'm looking for.