我已将Redux集成到我的RN项目中。我可以在带有按钮的屏幕之间导航,但是当我想回到HeaderBackButton时,它会说:" undefined不是函数"
Github-Repo:https://github.com/bayraktarhasan/React-Navigation-Redux-Globalization-Example.git
我的Feed组件:
printf '%s' \2
减速机:
class Feed extends Component {
static navigationOptions = {
title: 'Hello Ahmet',
headerLeft: <HeaderBackButton onPress={this.goBack()} />,
}
constructor(props) {
super(props);
this.goBack = this.goBack.bind(this);
}
goBack = () => {
this.props.navBack();
}
render() {
return (
<View style={styles.container}>
<Text>{I18n.t('feedComponent')}</Text>
<Button
title={I18n.t('back')}
onPress={this.goBack}
/>
</View>
);
}
}
export default connect(null, { navBack, navToProfile })(Feed);