Shraddha Agarwal
Shraddha Agarwal

Reputation: 303

How to show hand hover on ReactTable rows in "React.js"

<div>
     <ReactTable
         data={this.state.listFruitData}
         columns={columns}
         defaultPageSize={10}
         getTrProps={onRowClick}
     />
</div>
  1. I am actually populating data(listFruitData) in ReactTable from post request call.
  2. My requirement is I need to first select row of ReactTable may be using some background color so that it looks like the row is selected
  3. While I am selecting row I should get hand(icon) hover on ReactTable row
  4. How to do this?

Upvotes: 3

Views: 8810

Answers (1)

ibtsam
ibtsam

Reputation: 1710

You just need to add a style for cursor From your onRowClick function you can return a style object along with the onClick handler. In your onRowClick

onRowClick = () => {
return {
    onClick: () => {}, // your onClick handler
    style: {
           cursor: 'pointer'
    },
   }
}

Hope this helps

Upvotes: 10

Related Questions