react-simple-pull-to-refresh icon indicating copy to clipboard operation
react-simple-pull-to-refresh copied to clipboard

Use optional chaining instead of non-null assert

Open johnsonsu opened this issue 1 year ago • 1 comments

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.

johnsonsu avatar May 24 '23 19:05 johnsonsu

@thmsgbrt Can you appreciate this branch? It's an important fix.

MaksimLavrenyuk avatar May 22 '24 22:05 MaksimLavrenyuk