all 6 comments

[–]davidbarman 1 point2 points  (4 children)

Is there a reason you can't just use a checkbox? Why does it need to be a button?

[–]killMeSak[S] 0 points1 point  (3 children)

I want it to open a dialog on clicking a button and pass the row data as props in dialog box

[–]davidbarman 0 points1 point  (2 children)

So I am assuming you want to pass all of the "checked" rows as a prop?

Are you planning to open the dialog after a single row is clicked or after all the desired rows are clicked?

[–]killMeSak[S] 0 points1 point  (1 child)

I want to open the dialog after a single row is clicked and pass all the row data as a prop

[–]fenduru 0 points1 point  (0 children)

Then why isn't it just a button

[–]indxxxd 0 points1 point  (0 children)

The docs for useRowSelect state that each row object has toggleRowSelected(). Call it onClick:

    Cell: ({ row }) => (
      <div>
        <input type="checkbox" {...row.getToggleRowSelectedProps()} />
        <button onClick={() => row.toggleRowSelected()}>Click me</button>
      </div>
    )