React-native-pager-view: onPageSelected not working correctly

Created on 26 Jun 2019  路  2Comments  路  Source: callstack/react-native-pager-view

My issue is quite basic.
It might be something stupid but i haven't found any solution online anything related to it in the documentation.
I try to use the onPageSelected prop, expecting a number.
onPageSelected={this.onPageSelected}
and the method is
onPageSelected(pageIndex){ console.log(pageIndex) }
The output is a SyntheticEvent, and not a number.

All 2 comments

See the example: https://github.com/react-native-community/react-native-viewpager/blob/master/example/ViewPagerAndroidExample.android.js#L115-L117

  onPageSelected = e => {
    // You can access it by e.nativeEvent.position
  };

why not return index

Was this page helpful?
0 / 5 - 0 ratings

Related issues

troZee picture troZee  路  3Comments

troZee picture troZee  路  8Comments

hengkx picture hengkx  路  8Comments

iqbalfaisal picture iqbalfaisal  路  3Comments

KingAmo picture KingAmo  路  4Comments