Skip to content

Instantly share code, notes, and snippets.

@itsramiel
Created June 4, 2022 07:37
Show Gist options
  • Save itsramiel/2ab8cbbde9b7cec8e5025ef9ae462623 to your computer and use it in GitHub Desktop.
Save itsramiel/2ab8cbbde9b7cec8e5025ef9ae462623 to your computer and use it in GitHub Desktop.
import { Alert, Button, StyleSheet, Text, View } from "react-native";
import React from "react";
import { HomeProps } from "../navigation/types";
const Home = ({ navigation }: HomeProps) => {
const congratulateUser = () => {
Alert.alert("Here is a congratulations for following this tutorial and this function is written in Home");
};
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Button title="go to profile" onPress={() => navigation.navigate("Profile", { callback: congratulateUser })} />
</View>
);
};
export default Home;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment