I am using the Expo Managed React Native.
I am trying to use a drawer navigation and have followed the the React Navigation documentation here.
import React from 'react';
import { createDrawerNavigator } from '#react-navigation/drawer';
import { NavigationContainer } from '#react-navigation/native';
import HomeScreen from './src/screens/HomeScreen'
const Drawer = createDrawerNavigator();
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen} />
</Drawer.Navigator>
</NavigationContainer>
);
}
I run the expo start command and scan the QR code with my mobile phone.
When running, it throws this error and doesn't run at all. I have tried using a stack navigator and it works fine. Only when using the drawer navigator, the error shows up.
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export
your component from the file it's defined in, or you might have mixed up default and named imports.
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `DrawerNavigator`.
My dependencies are as follows
"dependencies": {
"#react-native-community/masked-view": "0.1.10",
"#react-navigation/drawer": "^6.0.0-next.21",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.5",
"expo": "~42.0.1",
"expo-linear-gradient": "~9.2.0",
"expo-splash-screen": "~0.11.2",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.8.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-gesture-handler": "~1.10.2",
"react-native-reanimated": "~2.2.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.4.0",
"react-native-unimodules": "~0.14.5",
"react-native-web": "~0.13.12",
"react-native-webview": "11.6.2",
"react-native-youtube-iframe": "^2.1.0"
},
i had the same problem, i changed the version > 6... with :
1 (uninstall)-> npm uninstall #react-navigation/drawer
2 -> npm install #react-navigation/drawer#^5.x
that is it!
check your #react-navigation/drawer with #react-navigation/native
Related
This is my app.js code
import React from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import { createDrawerNavigator } from '#react-navigation/drawer';
import { NavigationContainer } from '#react-navigation/native';
import Home from './src/components/Home';
import Login from './src/components/Login';
const Drawer = createDrawerNavigator();
function App() {
return(
<NavigationContainer>
<Drawer.Navigator>
<Drawer.Screen name="Home" component={Home} />
<Drawer.Screen name="Login" component={Login} />
</Drawer.Navigator>
</NavigationContainer>
)
}
export default App;
This is my dependency package
"dependencies": {
"#react-navigation/bottom-tabs": "^6.2.0",
"#react-navigation/drawer": "^6.3.1",
"#react-navigation/native": "^6.0.8",
"#react-navigation/native-stack": "^6.5.1",
"react": "17.0.2",
"react-native": "^0.65.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^1.13.2"
},
Error
ERROR TypeError: null is not an object (evaluating '_ReanimatedModule.default.createNode')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
When i try to start react-native this error comes...
Please any one help me and rectify me
I was getting the same error.
Upgrading the react-native-reanimated version to react-native-reanimated#2.2.0 solved my issue
I used npm install react-native-reanimated#2.2.0, after uninstalling the previous version
I had this error only with Drawer Navigation in Web.
Compiled with problems:X
ERROR in ./node_modules/react-native-reanimated/lib/createAnimatedComponent.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\react-native-reanimated\lib\createAnimatedComponent.js: Support for the experimental syntax 'jsx' isn't currently enabled (448:9):
446 | });
447 | return (
> 448 | <Component {...props} ref={this._setComponentRef} {...platformProps} />
| ^
449 | );
450 | }
451 | }
Add #babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add #babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
at Parser._raise (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:569:17)
at Parser.raiseWithData (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:562:17)
at Parser.expectOnePlugin (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:3626:18)
at Parser.parseExprAtom (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:12055:18)
at Parser.parseExprSubscripts (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11654:23)
at Parser.parseUpdate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11634:21)
at Parser.parseMaybeUnary (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11609:23)
at Parser.parseMaybeUnaryOrPrivate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11421:61)
at Parser.parseExprOps (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11428:23)
at Parser.parseMaybeConditional (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11398:23)
ERROR in ./node_modules/react-native-reanimated/lib/reanimated1/Transitioning.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\react-native-reanimated\lib\reanimated1\Transitioning.js: Support for the experimental syntax 'jsx' isn't currently enabled (36:7):
34 | return (props) => {
35 | return (
> 36 | <TransitioningContext.Consumer>
| ^
37 | {(context) => <Comp context={context} {...props} />}
38 | </TransitioningContext.Consumer>
39 | );
Add #babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add #babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
at Parser._raise (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:569:17)
at Parser.raiseWithData (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:562:17)
at Parser.expectOnePlugin (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:3626:18)
at Parser.parseExprAtom (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:12055:18)
at Parser.parseExprSubscripts (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11654:23)
at Parser.parseUpdate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11634:21)
at Parser.parseMaybeUnary (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11609:23)
at Parser.parseMaybeUnaryOrPrivate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11421:61)
at Parser.parseExprOps (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11428:23)
at Parser.parseMaybeConditional (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11398:23)
ERROR in ./node_modules/react-native-screens/src/screens.web.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\react-native-screens\src\screens.web.js: Support for the experimental syntax 'jsx' isn't currently enabled (105:12):
103 |
104 | render() {
> 105 | return <Animated.View {...this.props} ref={this._setRef} />;
| ^
106 | }
107 | }
108 |
Add #babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add #babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
at Parser._raise (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:569:17)
at Parser.raiseWithData (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:562:17)
at Parser.expectOnePlugin (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:3626:18)
at Parser.parseExprAtom (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:12055:18)
at Parser.parseExprSubscripts (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11654:23)
at Parser.parseUpdate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11634:21)
at Parser.parseMaybeUnary (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11609:23)
at Parser.parseMaybeUnaryOrPrivate (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11421:61)
at Parser.parseExprOps (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11428:23)
at Parser.parseMaybeConditional (C:\Users\weve\Documents\Projetos\ReactNative\Linguis\node_modules\#babel\parser\lib\index.js:11398:23)
Well I created a simple class and include my Drawer navigation (Note this issues happened only with drawer, because with #react-navigation/native-stack this is works)
Rn.tsx
import React from 'react';
import {NavigationContainer} from '#react-navigation/native';
import Message from "./Message.web";
import {createDrawerNavigator} from '#react-navigation/drawer';
const Drawer = createDrawerNavigator();
function MyDrawer() {
return (
<Drawer.Navigator>
<Drawer.Screen name="Message" component={Message} />
</Drawer.Navigator>
);
}
function Rn() {
return (
<NavigationContainer>
<MyDrawer />
</NavigationContainer>
);
}
export default Rn;
I call this in App.js
import 'react-native-gesture-handler';
enableScreens();
import React from 'react';
import {enableScreens} from 'react-native-screens';
import RouteWeb from './components/web/Rn';
import RouteNative from './components/native/Route.native';
import { Platform} from "react-native";
const App = () => {
return Platform.OS == "web" ? <RouteWeb/> : <RouteNative />
};
export default App;
Message.tsx
import React from "react";
import { View, Text } from "react-native";
const Message = () => {
return (
<View>
<Text>Message Web</Text>
</View>
);
};
export default Message;
My dependences in package.json
"dependencies": {
"#react-native-community/masked-view": "^0.1.11",
"#react-navigation/bottom-tabs": "^6.0.9",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/native-stack": "^6.2.5",
"babel-preset-react-native": "^2.1.0",
"i": "^0.3.7",
"npm": "^8.3.0",
"react": "17.0.2",
"react-dom": "^17.0.2",
"react-native": "^0.64.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^1.0.0-alpha.23",
"react-native-web": "^0.17.1",
"react-native-webview": "^11.15.0",
"react-navigation": "^4.4.4",
"react-responsive": "^9.0.0-beta.5"
}
babel.config.js
module.exports = {
presets: ["#babel/preset-react"],
//I tried to use this plugins below but doesn't work
// plugins: ["#babel/plugin-syntax-jsx", "react-native-reanimated/plugin"]
}
According to error I tried to include #babel/preset-react and after #babel/plugin-syntax-jsx in babel.config.js and didn't work.
I appreciate if someone can help me.
I solved this issue changing version following this topic https://githubmate.com/repo/react-navigation/react-navigation/issues/9758
and add this metro-transform-worker on package.json.
The final result was
"dependencies": {
"#react-native-community/masked-view": "^0.1.11",
"#react-navigation/bottom-tabs": "^6.0.9",
"#react-navigation/drawer": "^5.12.5",
"#react-navigation/material-bottom-tabs": "^6.0.9",
"#react-navigation/material-top-tabs": "^6.0.6",
"#react-navigation/native": "^5.9.4",
"#react-navigation/native-stack": "^6.2.5",
"babel-preset-react-native": "^2.1.0",
"i": "^0.3.7",
"metro-transform-worker": "^0.66.2",
"npm": "^8.3.0",
"react": "17.0.2",
"react-dom": "^17.0.2",
"react-native": "^0.64.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-pager-view": "^5.4.9",
"react-native-reanimated": "1.13.3",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.4.0",
"react-native-tab-view": "^3.1.1",
"react-native-web": "^0.17.1",
"react-native-webview": "^11.15.0",
"react-navigation": "^4.4.4",
"react-responsive": "^9.0.0-beta.5"
},
Add the following line in babel.config.js
plugins: ["#babel/plugin-syntax-jsx", "react-native-reanimated/plugin"],
And then add the following line in package.json
"resolutions": {
"react-native-reanimated": "^2.9.1"
},
Im trying to using stripe-react-native (with expo and using android) library but immediately I use the StripeProvider I got this error (I followed the Docs):
TypeError: null is not an object (evaluating '_NativeStripeSdk["default"].initialise')
This error is located at:
in StripeProvider (at App.js:35)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:409)
in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
in ThemeProvider (at NavigationContainer.tsx:90)
...
This is where I use it:
...
import { StripeProvider } from '#stripe/stripe-react-native'
//pass the ref to your navigation container
import { PersistGate } from 'redux-persist/integration/react'
import { store, persistor } from './store'
import { Provider } from 'react-redux'
import { AppTab } from './Navigation'
export default function App() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<StripeProvider
publishableKey="pk_live_L4zEu37Als6Z..."
>
<AppTab />
</StripeProvider>
</NavigationContainer>
</PersistGate>
</Provider>
)
}
my package.json:
...
"expo": "~41.0.1",
"expo-status-bar": "~1.0.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-web": "~0.13.12",
...
"#stripe/stripe-react-native": "^0.1.2",
....
I dont find anything on this problem can someone help me seeing what im doing wrong? thanks!
You'll need to update your Expo client, support for stripe-react-native was only added recently: https://github.com/stripe/stripe-react-native/issues/3#issuecomment-846225534
As I don't have enough reputation to comment, I'll have to post this as an answer. Extending Paul's solution, it's also helpful to checkout the "Upgrading your app" section of the Expo SDK 41 release blog post: https://blog.expo.io/expo-sdk-41-12cc5232f2ef#e10c.
Some key things to remember are that you will also need to upgrade the Expo apps on the devices you are using. If they are physical then use their respective app stores, and if not then you can can delete the apps and recreate them, or run expo client:install:ios and expo client:install:android. A final piece that helped me was to do a clean run after the upgrade: expo start -c.
I created a drawerNavigator and now I'm trying to add an icon to the header. The issue is when I add my HeaderButton I get this error:
Component exception
In the navigationOptions I tried to use both HeaderButton and CustomHeaderButton but it doesn't work and I can't seem to figure out the issue.
This is my code:
HeaderButton.js
import React from "react";
import { HeaderButton } from "react-navigation-header-buttons";
import { Ionicons } from "#expo/vector-icons";
const CustomHeaderButton = (props) => {
return (
<HeaderButton
{...props}
IconComponent={Ionicons}
iconSize={23}
color="black"
/>
);
};
export default CustomHeaderButton;
WelcomeScreen.js
import React from "react";
import { View, Text, StyleSheet, ImageBackground, Image } from "react-native";
import MainButton from "../components/MainButton";
import Colors from "../constants/Colors";
import { HeaderButtons, Item } from "react-navigation-header-buttons";
import HeaderButton from "../components/HeaderButton";
const WelcomeScreen = (props) => {
return (
<ImageBackground
source={require("../assets/images/tsl.jpg")}
style={styles.backgroundImage}
>
<Image
source={require("../assets/images/slogan.jpg")}
style={styles.logo}
/>
<View style={styles.buttonContainer}>
<MainButton
onPress={() => {
props.navigation.navigate({
routeName: "UserLogin",
});
}}
>
User Login
</MainButton>
<MainButton
onPress={() => {
props.navigation.navigate({ routeName: "DriverLogin" });
}}
>
Driver Login
</MainButton>
<View style={styles.newAccountContainer}>
<Text style={styles.newAccountText}>Don't have an account?</Text>
</View>
<View style={styles.registerContainer}>
<MainButton style={styles.registerButton}>Register now</MainButton>
</View>
</View>
</ImageBackground>
);
};
WelcomeScreen.navigationOptions = {
headerLeft: (
<HeaderButtons HeaderButtonComponent={HeaderButton}>
<Item title="Menu" iconName="ios-menu" />
</HeaderButtons>
),
};
Thank you!
For everybody who will get error (on Max's course, vid 173 :) ):
TypeError: (0, _native.useTheme) is not a function. (In '(0, _native.useTheme)()', '(0, _native.useTheme)' is undefined)
Try to add npm i --save #react-navigation/native
If it doesn't help, delete node_modules & package-lock.json, check & update your package.json to correct versions. Here is my dependencies:
"dependencies": {
"#expo/vector-icons": "^12.0.5",
"#react-navigation/native": "^5.9.4",
"expo": "40.0.0",
"expo-app-loading": "^1.0.1",
"expo-font": "~8.4.0",
"expo-status-bar": "~1.0.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.2",
"react-native-web": "^0.13.12",
"react-navigation": "^4.4.4",
"react-navigation-drawer": "^2.7.0",
"react-navigation-header-buttons": "^6.3.1",
"react-navigation-stack": "^2.10.4",
"react-navigation-tabs": "^2.11.0",
"react-redux": "^7.2.4",
"redux": "^4.1.0",
"redux-devtools-extension": "^2.13.9"
After you'll done this, just run npm install.
I hope that it will helps somebody. Learn and enjoy!=)
I had the same issue and I did npm i --save #react-navigation/native since the error stated that useTheme was not found.
Hi I've been having this exact same issue. I'm working through a react-native course on Udemy.
Obviously this is specific to the course code etc. but I hope something here can fix your issue also.
I tried a few things so I'm not exactly sure what fixed the issue... here is what I did:
I changed the react-navigation and react-navigation-header-buttons vesrsions in package.json to those which are used in Max's code (3.11.1 & 3.0.1 respectively) and I think I ran npm install. (to update them?)
App didnt work, wouldnt launch error with react-navigation-header-buttons
ran expo update, to update packages and re-build node_modules and package-lock.json
was given a list of packages which didnt update: expo-app-loading, react-navigation, react-navigation-drawer, react-navigation-header-buttons, react-navigation-stack, react-navigation-tabs
ran expo install react-navigation react-navigation-drawer react-navigation-header-buttons react-navigation-stack react-navigation-tabs
noticed react-navigation warning that v3.13.0 wasnt supported upgrade to 4.x
ran npm install react-navigation#4 installed 4.4.4
react-navigation-header-buttons was still at an older version 3.0.5, so I ran npm install react-navigation-header-buttons#6 installed 6.3.1
npm start - Apps are working on emulator and physical device!
My working app now has the following dependencies (in package.json):
"expo": "~40.0.0",
"expo-app-loading": "^1.0.1",
"expo-status-bar": "~1.0.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.2",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.4",
"react-navigation-drawer": "^2.7.0",
"react-navigation-header-buttons": "^6.3.1",
"react-navigation-stack": "^2.10.4",
"react-navigation-tabs": "^2.11.0"
I had the same, and resolved by:
expo install react-navigation-header-buttons#6
because npm install ... throw me an error
You need to go to your package.json file, and set the following version to the "react-navigation-header-buttons" package:
"react-navigation-header-buttons": "^6.3.1"
Then run npm install again and try to run your app.
Check dependency of react-navigation-header-buttons in package.json. It may not of version 6. If it is the case, then delete that line from package.json and reinstall navigation-header-button of version 6 using npm install --save react-navigation-header-buttons#6
"md-cart" is no longer available in the ionicons list, replace the iconName with a valid name like
iconName = "cart-outline"
in my case and it will start working!
yarn add #react-navigation/native or npm i --save #react-navigation/native should solve the problem.
For everybody who will get error (on Max's course, vid 173:), run this command:
npm install react-navigation-header-buttons#6
And it will fix the issue.
I followed this step and the error disappeared:
first:
npm install --save #react-navigation/native
or
yarn add #react-navigation/native
next:
delete node_modules And I reinstalled the packages again
I don't use Navigator in my codes. But I am getting this error.
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-router-redux": "^0.2.2",
"react-redux": "^5.0.5",
"redux": "^3.7.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.0.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
}
Anyone can help me?
This happened to me when my IDE automatically added the following lines:
import * as AsyncStorage from "react-native";
which means: everything in that file, which won't work. Solved it by changing to this:
import AsyncStorage from "react-native";
Navigator is no longer supported in react native so this is no longer allowed:
import { Navigator } from 'react-native'
Remove the Navigator from 'react-native' imports and substitute it with this:
import { Navigator } from 'react-native-deprecated-custom-components';
Navigation experimental(Previously Navigator) has been removed from React Native and moved to a separate package react-native-deprecated-custom-components. It has been deprecated and not recommended. To fix your old code you can perform following steps
Install package react-native-deprecated-custom-components
npm install react-native-deprecated-custom-components --save
Import NavigationExperimental(Previously Navigator)
import NavigationExperimental from 'react-native-deprecated-custom-comreponents';
Replace Navigator with NavigationExperimental.Navigator