我有一个包含两列的Reaction表,如下所示:
{
Header: 'Toe ID',
id: 'toe_id',
width: 250,
accessor: 'toe_id',
}, {
Header: 'Confirm',
id: 'confirm',
width: 130,
Cell: (props) => <button type="button" onClick={toeSearchButtonEvent(props)}>
Confirm Match
</button>
},
我正在try 将按钮的属性传递给下面的函数,以便在单击时获得行的属性:
function toeSearchButtonEvent(props) {
console.log(props)
}
然而,当前的行为是所有行的所有属性都一次性打印到控制台,并且在单击时不会触发每行上按钮的onClick事件.How do I get the desired behavior of just getting the property of the row of the button I click?个