Skip to content

Instantly share code, notes, and snippets.

@ranveerching

ranveerching/services.js Secret

Last active Oct 14, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.