我正在 React 中处理一个表单,我需要使用 event.preventDefault。同时我还需要向父函数传递其他参数。我尝试使用下面的代码正常添加它们,但似乎不起作用;我怎样才能做到这一点?我已经看过其他问题,但没有找到解决方案。
handleSubmit = (event, param1, param2) => {
event.preventDefault();
this.setState(prevState => {
// piece of code where i need to use the other parameters
});
}
Run Code Online (Sandbox Code Playgroud)