onMomentumScrollEnd and OnIndexChanged not firing
See original GitHub issueOn Windows 10
- react-native-swiper v1.5.12
- react-native v0.48.4
Oddly enough I have the same code on two pages, with just basic views, and on one it fires, and on the other it doesn’t. I’m getting no logs for anything.
I can’t fork the code because it’s private, but this is the gist of the code. Working code
render() {
return (
<View style={styles.container}>
<Header title={this.state.title} onPress={()=>this.props.navigation.goBack()}/>
<View style={styles.body}>
<View style={styles.routes}>
<Swiper loadMinimal={true} loadMinimalSize={4} showsPagination={false}>
{this.display()}
</Swiper>
</View>
<View style={styles.alpha}>
{this.displayAlpha()}
</View>
</View>
</View>
)
Not working code
onMomentumScrollEnd = (e, state, context) => {
Reactotron.log(this.state.List[state.index].title)
Reactotron.log(true, true)
}
render() {
return (
<View style={styles.container}>
<Header title={this.state.title} onPress={()=>this.props.navigation.goBack()} navigate={this.props.navigation.navigate}/>
<View style={styles.body}>
<View style={styles.routes}>
<Swiper loadMinimal={true} loadMinimalSize={4} showsPagination={false} onMomentumScrollEnd={this.onMomentumScrollEnd}>
{this.display()}
</Swiper>
</View>
<View style={styles.alpha}>
{this.displayAlpha()}
</View>
</View>
</View>
)
}
this.display() returns an array of basic <Text></Text> like components.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10
Top Results From Across the Web
react-native-swiper method scrollBy - Stack Overflow
If I click on index 0, 1 and 2 will stop working. If I click 2 times on 1 or 2, then the...
Read more >react-native-swiper | Yarn - Package Manager
changelog · [1.6.0-dev]. ViewPagerAndroid: react-native => @react-native-community/viewpager · [1.5.14]. fixes #582 (Android not setting this onLayout first?) · [ ...
Read more >react swiper active index | The AI Search Engine You Control
Margin,padding is not working ... PS: I tried to use onMomentumScrollEnd and onIndexChanged to monitor the index changes but neither works in the...
Read more >pinar - npm
There are no other projects in the npm registry using pinar. ... onMomentumScrollEnd, (event) => void, function, Called when <ScrollView> 's ...
Read more >ScrollView - React Native
If component have not been provided, the default ... Used to manually set the starting scroll offset. ... onMomentumScrollEnd .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well that was the root of my issue, retrieving the data on the screen caused it not to work, so I retrieved the data earlier and then propped it to the screen and it works.
Yes even in my case also it is not working. It is working fine if we are using static data, but not working when list is dynamic