我正在使用 reactjs-popup 和 react-data-table-component npm 库,我想在单击一行时打开一个弹出窗口。
这是我的代码:
onRowClicked = (rowData,e) => {
return (<Popup
trigger={/*e.target.value*/}
modal>
{
close => (
<div>
// some code
</div>
)
}
</Popup>)
}
render() {
return (
<DataTable
title={title}
columns={columns}
data={data}
highlightOnHover={true}
pointerOnHover={true}
onRowClicked={this.onRowClicked}
noDataComponent='No content'
/>
)
}
是否可以将trigger属性绑定Popup到单击的行?