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

TypeError: navigation.navigate is not a function

$
0
0
import React from 'react';import {Button, View, Text} from 'react-native';const RegistrationScreen = (navigation: any) => {  return (<View><Text>My Registration Page</Text><Button        title="Go Back"        onPress={() => navigation.navigate('HomeScreen')}></Button></View>  );};export default RegistrationScreen;

I am getting the error, when i use .tsx as extenstion of the file. ex: - RegistrationScreen.tsx, and then got the error//TypeError: navigation.navigate is not a function. (In 'navigation.navigate('HomeScreen')', 'navigation.navigate' is undefined) //


Viewing all articles
Browse latest Browse all 6215

Trending Articles



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