Avedis Maroukian
Avedis Maroukian

Reputation: 1608

Background Color on Row when selecting row React Table

I'm doing a custom table with React Table & Typescript and I did when selecting a row on a checkbox it must change the checkbox and update the background color for the ones that are selected.

The problem is when I select the row for the first time, it works as expected but then when I click it again it doesn't update the background color. I'm using the property of row.isSelected to put the background color.

<Tr
 {...row.getRowProps()}
 style={{
 backgroundColor: !row.isSelected ? "none" : "#E9D8FD",
}}

The list is being updated correctly but the background color doesn't.

I'm missing something ?

Upvotes: 1

Views: 2429

Answers (1)

Cindy
Cindy

Reputation: 53

"none" is not a valid color. You may want to use "transparent" instead.

Upvotes: 2

Related Questions