react-simple-pull-to-refresh
react-simple-pull-to-refresh copied to clipboard
Use optional chaining instead of non-null assert
Fix #81
Due to events like onScroll
that this library listens to are not synchronous, they can be fired right after the component is already unmounted, causing ref.current
to be null
. This PR fixes the issue by using optional chaining instead of non-null assertion on ref.current
usages.
@thmsgbrt Can you appreciate this branch? It's an important fix.