'Snackbar not getting hidden during screen navigation

import { Snackbar } from 'react-native-paper'

<Snackbar
     visible={visible}
     onDismiss={handleDismiss}
     action={{
       label: 'hide',
       onPress: handleDismiss,
     }}
     duration={Snackbar.DURATION_SHORT}
     style={styles.snackText}
   >
     {text}
</Snackbar>

Once after the Snackbar appears, if screen navigation is continuously done, the Snackbar is not getting hidden after the specified duration value. I think the duration is getting reset to its initial value if screen navigation is made. If I stop navigation and stay idle for the specified duration value, then only the Snackbar is closing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source