deanmcpherson / react-native-sortable-listview

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

Fix undefined refs crashes #115

Closed Minishlink closed 6 years ago

nihgwu commented 6 years ago

just curious, when will the refs is undefined, per you another PR, seems you pass a functional component which has no refs itself, but I don't think it would happen with a class component, as you can only access those methods after the component is rendered

Minishlink commented 6 years ago

We had a crash on this.refs.view.measure. I took the liberty to add checks for this.refs.list too since there were none, it's quite standard to do that for refs btw :)

nihgwu commented 6 years ago

But it should be always safe to access refs after component is mounted, curious on how the crash happens

Arunkumar-Precise commented 6 years ago

I have same problem when navigate quickly, happen this,

1510136584652 jpeg

How can i solve it?

nihgwu commented 6 years ago

well it's always be good to be cautious, I'd love to land this, thanks