How to: React Table with Double Click

 by Robin Wieruch
 - Edit this Post

This tutorial is part 2 of 2 in this series.

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:

<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:

<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.

Keep reading about 

In this tutorial, I want to show you how to use React Table Library with its useRowSelect plugin to implement a select feature. In the previous example, you installed React Table Library to create…

In this tutorial, I want to show you how to use React Table Library to create a Tree Table or Tree List . In the previous example, you installed React Table Library to create a table component…

The Road to React

Learn React by building real world applications. No setup configuration. No tooling. Plain React in 200+ pages of learning material. Learn React like 50.000+ readers.

Get it on Amazon.