Reactjs 已绑定到组件的函数仍显示未捕获类型错误的错误:\ this4.handleDeleteItem不是函数
我已经在我的组件构造函数中绑定了该函数,但它仍然显示带有未捕获TypeError的错误:\u this4.handleDeleteItem不是函数。我正在使用react引导表2列格式化程序来编辑和删除按钮,我想从那里设置状态Reactjs 已绑定到组件的函数仍显示未捕获类型错误的错误:\ this4.handleDeleteItem不是函数,reactjs,function,react-bootstrap-table,Reactjs,Function,React Bootstrap Table,我已经在我的组件构造函数中绑定了该函数,但它仍然显示带有未捕获TypeError的错误:\u this4.handleDeleteItem不是函数。我正在使用react引导表2列格式化程序来编辑和删除按钮,我想从那里设置状态 return ( <div className="text-center"> <button type="button" className="btn btn-warning mr-1">
return (
<div className="text-center">
<button type="button" className="btn btn-warning mr-1">
<FontAwesomeIcon icon={ faEdit }/>
</button>
<button type="button" className="btn btn-danger" onClick={() => this.handleDeleteItem(row.id)}>
<FontAwesomeIcon icon={ faTrash }/>
</button>
</div>
)
}
请显示定义
handleDeleteItem
的位置。请显示定义handleDeleteItem
的位置。
this.setState({
showModal: true,
delItem: item_id
});
}