react-native-parallax-scroll-view icon indicating copy to clipboard operation
react-native-parallax-scroll-view copied to clipboard

onPress events do not take effect , goBack() Did not perform

Open xushan1303616 opened this issue 4 years ago • 2 comments

render() { return ( <View style={{flex: 1}}> <ParallaxScrollView parallaxHeaderHeight={270} renderForeground={this.renderForeground} > {this.renderContent()} </ParallaxScrollView> </View> ); }

// header renderForeground=() => { return <View style={styles.foreground} key="parallax-header"> <View style={styles.Icons}> <TouchableOpacity onPress={this.goBack}> <Ionicons name={'ios-arrow-back'} size={26} color={'white'}/> </TouchableOpacity> </View> };

// important: goBack() Did not perform
goBack = () => { let {navigation} = this.props; navigation.goBack() };

xushan1303616 avatar Oct 10 '20 11:10 xushan1303616

I defined an icon button in the renderForeground, hoping to return to the previous page by clicking the icon button, but this icon button did not return to the previous page. You can go back to the previous page if you define the icon button elsewhere. Why the icon button defined in the renderForeground cannot return to the previous page, and why the onPress event is not executed for the icon defined in the renderForeground

xushan1303616 avatar Oct 10 '20 11:10 xushan1303616

@xushan1303616 xushan1303616 facing same problem on my application, please share if you get any solution

RevanthGovindan avatar Jan 31 '21 13:01 RevanthGovindan