react-native-onboarding-swiper icon indicating copy to clipboard operation
react-native-onboarding-swiper copied to clipboard

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

Open alexander01202 opened this issue 3 years ago • 2 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 ??

alexander01202 avatar Mar 28 '22 19:03 alexander01202

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 avatar Mar 28 '22 22:03 jfilter

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

export default class Onboarding extends Component<Props> { 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

poinch avatar May 03 '22 10:05 poinch