BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
939 stars 327 forks source link

Fix error on unmount: ref null is not an object (evaluating 'n.rlv.scrollToIndex') … #219

Closed cc-matthias-m closed 4 years ago

cc-matthias-m commented 4 years ago

Hello,

I found a bug in Scroller component. This bug is triggered in a specific case.

First the user have to reach the limit data.length < this.props.maxSimultaneousDays with scroll. Then, when the setTimeout is invoked but not consume yet (800ms), the user unmount the component (i.e. by moving to the screen back).

I think that my explanation is not clear enough so I record the bug.

Crash null

I added a clearTimeout at the unmount of the component.

Seems to be fixed now.

If something need to be changged in this PR, ask me.

Thanks for your work.

Have a good day

peacechen commented 4 years ago

Thanks @cc-matthias-m for fixing this bug 👍