You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Navigator is deprecated in RN 0.44.0 and not working #1328
after upgrade react native to 0.44.0 i get this error :
i use react-navigation 1.0.0-beta.9 package and i got BackAndroid deprecated too .
Navigator is deprecated and has been removed from this package. It can now be installed and imported from react-native-deprecated-custom-components instead of react-native. Learn about alternative navigation solutions at http://facebook.github.io/react-native/docs/navigation.html
@grabbou but i think you closed immediatly without any define a correct solution .
as i see in the relative module codes there is a dependency in react-navigation for Navigate component yet .
so i think this issue must be reopened till solve this problem .
Reacted by Miguel Garcia, Ebin Joy, Mohammad M Aslami, Francesco Sardo, Luke Stanbery and Pallav Bakshi
There's no issue to be solved. Navigation experimental has been removed from React Native and moved to a separate package that I've listed above. You should slowly upgrade your code to use a new navigation library, like this one. Before that happens, you can keep on using Navigation Experimental from the above package.
Reacted by Poppe
Reacted by Ben, damon lean, Mathieu Mailhos, James Dorrian, Dhaval Jardosh, dangbh1002-org, Nima Moradi, Shuai Han, James O, Mohammad M Aslami and 14 more
hi,grabbou,i read your tips and installed react-native-deprecated-custom-components,and import Navigator from 'react-native-deprecated-custom-components' ,but an error occured,it said that Element type is invild:excepted a string or a class/function but got: object;
and i just has an Navigator in there ,so can you help me with that? Thanks!
Reacted by Gabriel Garrett, Ben, ggsrivas, FANG Zhou and Serhii
@muxiaodeng I think you should import NavigationExperimental and not Navigator:
import {NavigationExperimental} from 'react-native-deprecated-custom-components';
Fixed with:
import NavigationExperimental from 'react-native-deprecated-custom-components';
Use with:
<NavigationExperimental.Navigator
Reacted by Son Nguyen, dcp12345678, Simon Hintersonnleitner, Support Clik tecnologia, Nontachai Tantiponsawas, Quinn Sheng, neurallambda, Pocho Costa, zengkm, swapnali and 15 more
Reacted by Jeremy Shiklov, thangpq, metalmalte, cmcgheit, jbarradas, Nikhil, Hariks and Tom Hayden
Reacted by Son Nguyen, Miguel Araujo, Simon Hintersonnleitner, Connie (CJ) Chang, zengkm, metalmalte, jbarradas and Hariks
@rexjrs Because in last version it don't use Navigator in react-native . It switch to use react-native-deprecated-custom-components. You can see notied when running app.
Hey Chaps I am using import { StackNavigator } from 'react-navigation'; and I am getting the same error. The solution on here will not work since it is the newest version of react-navigation which needs to be fixed in order for react-native to work. Does anyone know when react-navigation be upgraded to use non deprecated modules?
I had the error even though I wasn't trying to use Navigator. It turns out the error was thrown because I accidentally had this line (my IDE had auto-inserted it):
import * as Platform from 'react-native'
Changing that to
import { Platform } from 'react-native'
Fixed the issue. It turns out if you do import * as Foo from 'react-native' it triggers RN's warnings about deprecated/removed exports, which completely threw me off. HTH
Reacted by Adriano Skroch, Jonathan Hollingsworth, Yar Malik , Lolobosse (old JN), Fernando Brito, Egor Merkushev, Nextfunc Admin, Vladymir González and DenisMl
@rh389 Thank you, you saved my life, was getting this error even not using the Navigator.
I trusted the IDE to do an import and it imported like this: import * as Messages from "react-native";
That was causing the problem.
Hi @andreia-sl By downgrading react native versions and resetting the cache with the following line script : rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache My code is working fine now but got some warnings.
if depresiate and pakage is remove ---error
naivigatorExperimental import and < NaivigatorExperimental.Navigator /> used this two statement perfect run your programme
if you already upgrade react-navigation and you still see this error probably its not about the react-navigation. So you should upgrade which is using BackAndroid packages. I found a way;
Just search BackAndroid in your node_modules So thats for the understand which is using deprecated thing.
Then just upgrade them to latest version or fixed version for BackAndroid. NO NEED INSTALL ANYTHING!
These are my dependency. I got same issue after upgrade to 0.58.3 And I solved this as above solution.
Activity
grabbou commentedon May 1, 2017
As error message indicates, you should install react-native-deprecated-custom-components and import NavigationExperimental from there.
amirrezamahyari commentedon May 1, 2017
@grabbou but i think you closed immediatly without any define a correct solution .
as i see in the relative module codes there is a dependency in react-navigation for Navigate component yet .
so i think this issue must be reopened till solve this problem .
grabbou commentedon May 1, 2017
There's no issue to be solved. Navigation experimental has been removed from React Native and moved to a separate package that I've listed above. You should slowly upgrade your code to use a new navigation library, like this one. Before that happens, you can keep on using Navigation Experimental from the above package.
muxiaodeng commentedon May 4, 2017
hi,grabbou,i read your tips and installed react-native-deprecated-custom-components,and import Navigator from 'react-native-deprecated-custom-components' ,but an error occured,it said that Element type is invild:excepted a string or a class/function but got: object;
and i just has an Navigator in there ,so can you help me with that? Thanks!
ashish-algorythma commentedon May 4, 2017
@muxiaodeng I think you should import NavigationExperimental and not Navigator:
import {NavigationExperimental} from 'react-native-deprecated-custom-components';
muxiaodeng commentedon May 5, 2017
@ashish-algorythma thanks,but it didn't work,still say Element type is invalid;
Juxtlie commentedon May 5, 2017
I have the same problem
Juxtlie commentedon May 5, 2017
@amirrezamahyari Do you have resolve?
davidck commentedon May 5, 2017
Fixed with:
import NavigationExperimental from 'react-native-deprecated-custom-components';
Use with:
<NavigationExperimental.Navigator
nvs2394 commentedon May 6, 2017
I fixed it with code
rexjrs commentedon May 7, 2017
Why was React Navigator deprecated?
nvs2394 commentedon May 8, 2017
@rexjrs Because in last version it don't use Navigator in react-native . It switch to use react-native-deprecated-custom-components. You can see notied when running app.
rexjrs commentedon May 8, 2017
No. My question is, what was the reason behind deprecating the Navigator component? Was it bad, were there much better alternatives? etc.
peterheard01 commentedon May 8, 2017
Hey Chaps I am using
import { StackNavigator } from 'react-navigation';and I am getting the same error. The solution on here will not work since it is the newest version ofreact-navigationwhich needs to be fixed in order forreact-nativeto work. Does anyone know whenreact-navigationbe upgraded to use non deprecated modules?28 remaining items
anniewey commentedon Nov 1, 2017
@roysG use PropTypes.func instead of React.PropTypes.func if you haven't implement the changes
astw commentedon Nov 1, 2017
There are a lot breaking changes!
sven0726 commentedon Nov 19, 2017
i have the same error
robhogan commentedon Nov 28, 2017
I had the error even though I wasn't trying to use
Navigator. It turns out the error was thrown because I accidentally had this line (my IDE had auto-inserted it):import * as Platform from 'react-native'Changing that to
import { Platform } from 'react-native'Fixed the issue. It turns out if you do
import * as Foo from 'react-native'it triggers RN's warnings about deprecated/removed exports, which completely threw me off. HTHunmec commentedon Dec 2, 2017
They are often too many breaking changes. Update the codebase of your existing project is a nightmare.
adrianolsk commentedon Dec 3, 2017
@rh389 Thank you, you saved my life, was getting this error even not using the Navigator.
I trusted the IDE to do an import and it imported like this:
import * as Messages from "react-native";That was causing the problem.
Dev-SaiVarunPadala commentedon Jan 10, 2018
Hi @roysG did you solved that error?
Dev-SaiVarunPadala commentedon Jan 10, 2018
@saeedtabrizi Hi, I have commented the code(Navigator) in the node_modules but it's throwing a new error

@peterheard01 how to update this below code to use StackNavigator
andreia-sl commentedon Jan 30, 2018
@VarunDcoder I'm going through the same situation. Did you solve the problem?
Dev-SaiVarunPadala commentedon Feb 5, 2018
Hi @andreia-sl By downgrading react native versions and resetting the cache with the following line script :
rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cacheMy code is working fine now but got some warnings.andreia-sl commentedon Feb 5, 2018
I gave up using the Navigator and am using RouterFlux. But thx @VarunDcoder
JAYANTdEV commentedon Apr 23, 2018
if depresiate and pakage is remove ---error
naivigatorExperimental import and < NaivigatorExperimental.Navigator /> used this two statement perfect run your programme
ilpanda commentedon Aug 23, 2018
you show use this now :
import {Navigator} from 'react-native-deprecated-custom-components'
ue commentedon Jan 30, 2019
if you already upgrade
react-navigationand you still see this error probably its not about thereact-navigation. So you should upgrade which is usingBackAndroidpackages. I found a way;Just search
BackAndroidin yournode_modulesSo thats for the understand which is using deprecated thing.Then just upgrade them to latest version or fixed version for
BackAndroid.NO NEED INSTALL ANYTHING!
These are my dependency. I got same issue after upgrade to
0.58.3And I solved this as above solution.Migrate 'Stack Actions' examples to static API in v7 (react-navigatio…