REACT NATIVE APP DEVELOPMENT
Let's say on Screen A I have a button. I want to be able to press that button and get an Alert onto Screen B.
On this Screen B, I want the Alert to be more like a notification where it stays there until the user clicks on the alert/notification to complete a task.
const taskedClick = () => {
Alert.alert('I am the ALERT'); //I WANT THIS ALERT TO SHOW ON MY NOTIFICATION SCREEN AS A NOTIFICATION
}
return (
<View>
<Button onPress={taskedClick}
style={styles.leftButton}
type="solid"
title={post.leftUser.leftButton}
/>
</View>
The code above has a working button with a working alert but the alert appears on the screen where the button is visible. This is the home screen. I have a notification screen where I want the alert to notify the user that the button was clicked on.
I am using Stack.Navigator and Stack.Screen for my screen names.