我正在使用RN0.24和flux3.26。 RN版本可能已过时但Actions.xxx
在我使用onPress={Actions.xxx}
时工作正常
但是,一旦我将它放入像onPress={this.function}
这样的函数中,我就会执行它
function(event){ Actions.xxx; }
然后它无效
有人能帮忙吗?
答案 0 :(得分:1)
这是this
问题,我想您可以尝试:
render() {
const login = () => { Action.login() }
return (
<View style={styles.container}>
<Text style={styles.welcome} onPress={ login }>
Go to Login
</Text>
</View>
);
}
}
希望这对他有帮助。