Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6597

How to call an async cleanup function?

$
0
0

How can I call an async cleanup function in useEffect?

useEffect(() => {    return () => Voice.destroy().then(Voice.removeAllListeners);  }, []);

The EffectCallback expects void, not Promise<void>


Viewing all articles
Browse latest Browse all 6597

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>