0

I want Webview to open the previous page when I press the back button on the phone. How can I do it? What do I need to add where in my code?

I tried the Handler concept, but I always got the error that the go Back() function does not exist. What do I need to add where in my code?

import * as React from 'react';
import { StyleSheet } from 'react-native';
import WebView from 'react-native-webview';
import EditScreenInfo from '../components/EditScreenInfo';
import { Text, View } from '../components/Themed';
import { RootTabScreenProps } from '../types';



export default function TabOneScreen({ navigation }: RootTabScreenProps<'TabOne'>) {

  return (
    <WebView 
    style={styles.container}
    source={{ uri:'https://www.ankarajantlastik.com/index.php?route=common/home' }}

  />
  );
  }

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
   },
  title: {
    fontSize: 20,
    fontWeight: 'bold',
   },
  separator: {
    marginVertical: 30,
    height: 1,
    width: '80%',
   },
 });
luk2302
  • 55,258
  • 23
  • 97
  • 137
Agartha
  • 1
  • 2
  • Does this answer your question? [React Native Webview make back button on android go back](https://stackoverflow.com/questions/65882469/react-native-webview-make-back-button-on-android-go-back) – user18309290 Dec 26 '22 at 16:51

0 Answers0