jfilter / react-native-onboarding-swiper

🛳 Delightful onboarding for your React-Native app
https://www.npmjs.com/package/react-native-onboarding-swiper
Other
971 stars 179 forks source link

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

Open alexander01202 opened 2 years ago

alexander01202 commented 2 years ago

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

`<TouchableWithoutFeedback onPress={() => onboardingRef.current.goToPage(0, true)}>

    </TouchableWithoutFeedback>`

This is my code. Any ideas ??

jfilter commented 2 years ago

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

// @ts-nocheck
poinch commented 2 years ago

@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