我需要将两个参数传递给我的处理程序功能,但是我找不到正确的sintax,有人可以帮助我?
MyHandler = (e) => {
var Var_1 = e;
var Var_2 = second_parameter;
}
render() {
return (
<Button onPress={(e) => this.MyHandler(e)} title="1">
);
}
您可以做到这一点:
MyHandler = (e, second_parameter) => {
var Var_1 = e;
var Var_2 = second_parameter;
}
render() {
return (
<Button onPress={(e) => this.MyHandler(e, your_second_parameter)} title="1">
);
}