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

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 6287

Trending Articles