From 0010cf7ee5942a7d4372aecf0fd99632a108953d Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Mon, 1 Aug 2022 23:12:38 -0500 Subject: [PATCH] back handler handling --- squarenotsquare/src/screens/Home.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/squarenotsquare/src/screens/Home.js b/squarenotsquare/src/screens/Home.js index ba59372..8e825f6 100644 --- a/squarenotsquare/src/screens/Home.js +++ b/squarenotsquare/src/screens/Home.js @@ -1,11 +1,15 @@ -import React from "react"; -import { Text, View } from "react-native"; +import React, { useEffect } from "react"; +import { BackHandler, Text, View } from "react-native"; import { useState } from "react"; import { styles } from './styles/AppStyles'; import { TouchableOpacity } from "react-native-gesture-handler"; function Home(props){ + useEffect(() => { + BackHandler.addEventListener('hardwareBackPress', () => {return true}); + }, []) + return (