How to: React Table with Double Click
Robin Wieruch •
In this tutorial, I want to show you how to use React Table Library with double click on a row. In the previous example, you installed React Table Library to create a table component. A single click on a row is enabled in the following way:
javascript
<Row
key={item.id}
item={item}
onClick={(node, event) =>
console.log('Click Row', node, event)
}
>By contrast, a double click on a row can be achieved in this way:
javascript
<Row
key={item.id}
item={item}
onDoubleClick={(node, event) =>
console.log('Double Click Row', node, event)
}
>Keep in mind that enabling double click on a row leads to a slight delay in selecting the row (if used), because the table waits for a while before it confirms the click as a single click, thus making sure that the click was not part of a double click.