如何在JavaScript OnClick事件中调用多个功能?
< button onClick = {(e)=> setId(_id); thandletelete()}>删除
我尝试过的方式,但会出现错误。
<Button onClick={(e)=>setId(_id); handleDelete()}>Delete
I tried this way, but it gives error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您必须将箭头功能的内容包裹在{}中,
按钮组件的关闭标签。
并且不要忘记我希望解决您的问题的
I think you must wrap the content of the arrow function in { }, like this
and don't forget the closing tag for the Button component
I hope that solves your problem.