I am getting the following error: (0 _reactNavigationStack.createAppContainer) is not a function. I got this error after installing react-native-gesture-handler and linking it. However, I check the terminal and there are no error messages appearing. The ios simulator is telling me that it is in App.JS, where I created the navigator, in the line where I have export deafult. I was wondering if anyone can see something I may not be seeing.
This is how I have my navigator set up, which is in the App.js file.
import {
createStackNavigator,
createAppContainer
} from 'react-navigation-stack';
import SearchScreen from './src/screens/SearchScreen';
const navigator = createStackNavigator(
{
Search: SearchScreen,
},
{
initialRouteName: 'Search',
defaultNavigationOptions: {
title: 'Buisness Search',
},
},
);
export default createAppContainer(navigator)
;
If you are using React v4 and higher the code below should work
import { createStackNavigator } from "react-navigation-stack";
import { createAppContainer } from "react-navigation";
This is because createAppContainer
is not exported by react-navigation-stack
You can import it from react-navigation
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
First install the dependencies :
run npm install react-navigation@^3.0.0
run npm install react-native-gesture-handler
Then import it in your code :
import { createStackNavigator} from "react-navigation-stack"
import { createAppContainer} from 'react-navigation'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With