You are using the Snackbar component from React Native Paper. If you look at the docs here, you will notice the Snackbar already is an alert, and you should not be adding another Alert inside it.
<Snackbar
visible={visible}
onDismiss={onDismissSnackBar}
action={{
label: 'Undo',
onPress: () => {
// Do something
},
}}>
The file has been Uploaded Successfully
</Snackbar>
In that same example you will find a Button component:
<Button onPress={onToggleSnackBar}>{visible ? 'Hide' : 'Show'}</Button>
This button has an onToggleSnackBar
function. This is where you should check if the text area is empty or not.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…