-
-
Save ranveerching/63c06caf5880427ddb2cb487a5246f29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const listItems = new Array(100).fill(null).map((_, index) => { | |
return { | |
id: index, | |
title: `Title ${index + 1}` | |
} | |
}); | |
export const onTabPress = (navigation, route) => { | |
if (navigation?.isFocused?.()) { | |
route?.params?.scrollToTop?.(); | |
} | |
}; | |
export const scrollToTop = (navigation, ref) => { | |
navigation.setParams({ | |
scrollToTop: () => ref?.current?.scrollToOffset(0, 0, true) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment