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

How to wait for an fadeout function to end?

$
0
0

I would like to change a value when a fadeOut function is over.

I have the following function:

    const fadeOut = (duration: number = 300) => {        Animated.timing(            opacity,            {                toValue: 0,                duration,                useNativeDriver: true            }        ).start();    }

And I call it this way:

    const fadeOutScreen = () => {        fadeOut(1000);        // The value would be true when the fadeOut is over        setHide(true);    }

But the value is changed before the operation ends.

How can I solve this?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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