deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native
MIT License
917 stars 235 forks source link

Style the non active rows when an active row exists. #131

Closed TLenahan closed 6 years ago

TLenahan commented 6 years ago

I see that the renderRow function prop has a boolean to tell if the row is active, but I am trying to apply a style to the non active rows when there is an active row, if the makes sense.

To clarify, I am trying to darken the non active rows when the user is sorting. Does anyone know how to do this, or if it is currently possible?

nihgwu commented 6 years ago

I think you can use onRowActive and onMoveCancel/onMoveEnd to achieve this

TLenahan commented 6 years ago

I have tried that, and the Row components are not updating unless I change shouldComponentUpdate to always return true. Is there something special I have to do?

TLenahan commented 6 years ago

I was able to resolve this by using PureComponent throughout index.js and removing shouldComponentUpdate