jfilter / react-native-onboarding-swiper

🛳 Delightful onboarding for your React-Native app

Home Page:https://www.npmjs.com/package/react-native-onboarding-swiper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: onboardingRef.current.goToPage is not a function. (In 'onboardingRef.current.goToPage(0, true)', 'onboardingRef.current.goToPage' is undefined)

alexander01202 opened this issue · comments

I am trying to go to the previous page programmatically but everytime I get this error.

<TouchableWithoutFeedback onPress={() => onboardingRef.current.goToPage(0, true)}> <View style={styles.backButton}> <AntDesign name="arrowleft" style={{ top:Dimensions.get('window').height < 596 ? 30 : 0,shadowColor:'black' }} size={24} color="black" /> </View> </TouchableWithoutFeedback>

This is my code. Any ideas ??

It looks like a type error. You can disable type checking for a file be adding the following to it's start:

// @ts-nocheck

@jfilter Hey, looks like goToPage is not available as Type.

export default class Onboarding extends Component {
flatList?: FlatList;
goNext: () => void;
}

i need to show a custom prev button even if i'm at the last page.
Alternative to how achieve that?

Thanks