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

Error while adding NavigationContainer in react native with typescript

$
0
0

When I define my NavigationContainer on separate file I get following error:

'NavigationContainer' refers to a value, but is being used as a type here. Did you mean 'typeof NavigationContainer'?

But when I define it in App.tsx works.

import React from 'react'import { NavigationContainer } from '@react-navigation/native';import { createStackNavigator } from '@react-navigation/stack';const Stack = createStackNavigator();function AppNavigator() {  return (<NavigationContainer><Stack.Screen        name={Routes.SPLASH}        component={SplashScreen}        options={{          headerShown: false,        }}      /></NavigationContainer>  )}export default AppNavigator

What is my problem?


Viewing all articles
Browse latest Browse all 6213

Trending Articles



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