I'm using react-table npm module, I want to change the style of a row on hover(onMouseEnter). I found the below option in their documentation which lets style all the rows, but I want to style each row on hover I tried using onMouseEnter and give the styling but it isn't taking that. Any suggestions!
getTrProps={(state, rowInfo, column) => {
return {
style: {
background: rowInfo.age > 20 ? 'green' : 'red'
}
}
}}
Probably you already solved your issue
This is a great way:
Inside the events you can do things to the state, rowInfo, styling, etc.
previous answer from @rishikarri for old version of React-table.
in my case i do this in .scss
i took this from here
I would try solving this using CSS. Example below:
I grabbed this from here: https://codepen.io/tannerlinsley/pen/rmeGBP?editors=0110
He solves it another way here: http://codepen.io/tannerlinsley/pen/bWprzr?editors=0010
Cheers!