Navigator is deprecated in RN 0.44.0 and not working
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
how can i fix this ?
| software | version |
|---|---|
| react-navigation | 1.0.0-beta.9 |
| react-native | 0.44.0 |
| node | 7.9.0 |
| npm or yarn | 4.2.0 |
As error message indicates, you should install react-native-deprecated-custom-components and import NavigationExperimental from there.
@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 .
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.
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!
@muxiaodeng I think you should import NavigationExperimental and not Navigator: import {NavigationExperimental} from 'react-native-deprecated-custom-components';
@ashish-algorythma thanks,but it didn't work,still say Element type is invalid;
I have the same problem
@amirrezamahyari Do you have resolve?
Fixed with: import NavigationExperimental from 'react-native-deprecated-custom-components';
Use with: <NavigationExperimental.Navigator
I fixed it with code
import {
} from 'react-native';
import Movies from './Movies';
import NavigationExperimental from 'react-native-deprecated-custom-components';
const RouteMapper = (route, navigator) => {
if (route.name === 'movies') {
return <Movies navigator={navigator} />;
}
};
export default class App extends Component {
render() {
return (
<NavigationExperimental.Navigator
// Default to movies route
initialRoute={{ name: 'movies' }}
// Use FloatFromBottom transition between screens
configureScene={(route, routeStack) => NavigationExperimental.Navigator.SceneConfigs.FloatFromBottom}
// Pass a route mapper functions
renderScene={RouteMapper}
/>
);
}
}
Why was React Navigator deprecated?
@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.
No. My question is, what was the reason behind deprecating the Navigator component? Was it bad, were there much better alternatives? etc.
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?
@saeedtabrizi see this issue
@amirrezamahyari HAZA MEN FAZLE RABBI, thanks a lot .
@peterheard01 , @rexjrs for the solve this problem we commented Navigation component in react native folder in node_modules :) only deprecated message is root of this problem so when we remove Navigation component from react , that working as well as my car :)
@saeedtabrizi can you clearly explain what you mean by comment in react native folder in node modules? How can I do this.
@saeedtabrizi thanks MOHANDES
@rexjrs
ok , i comment this lines and its already ok:
node_modules/react-native/Libraries/react-native/react-native-implementation.js
line 129

Thank you very much!
@davidck Did you need to pull in something from NPM too? I get a 500 error when i use react-native-deprecated-custom-components. Thanks.