Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

React Native WebView Back Button

$
0
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%',   }, });

Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>