I get the following error.
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
Then I would update react-native-deprecated-custom-components package but issue not solved
Package.Json
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.44.2",
"react-native-deprecated-custom-components": "^0.1.0",
"sendbird": "^3.0.30"
},
main.js
var React = require('react-native')
var {
Navigator,
StyleSheet
} = React;
var Login = require('./components/login');
import NavigationExperimental from 'react-native-deprecated-custom-components';
var ROUTES = {
login: Login
};
module.exports = React.createClass({
renderScene: function(route, navigator) {
var Component = ROUTES[route.name];
return <Component route={route} navigator={navigator} />;
},
render: function() {
return (
<NavigationExperimental.Navigator
style={ styles.container }
initialRoute={ {name: 'login'} }
renderScene={this.renderScene}
configureScene={ () => { return Navigator.SceneConfigs.FloatFromRight; } }
/>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1
}
});
Any one let me know to solve this issue
This version has been deprecated This version of React Navigation is no longer supported.
Installation To use this navigator, ensure that you have @react-navigation/native and its dependencies (follow this guide), then install @react-navigation/native-stack : npm. Yarn.
While React Navigation 5 was complete overhaul to the API of React Navigation, React Navigation 6 keeps the same API, with some breaking changes to make things more consistent and provide more flexibility. We also tried to address some common pain points and confusions that users had.
Provides a way for your app to transition between screens where each new screen is placed on top of a stack. By default the stack navigator is configured to have the familiar iOS and Android look & feel: new screens slide in from the right on iOS, fade in from the bottom on Android.
Ive use below code to fix my issue
main.js
var React = require('react-native')
var {
Navigator,
StyleSheet
} = React;
var Login = require('./components/login');
import NavigationExperimental from 'react-native-deprecated-custom-components';
var ROUTES = {
login: Login
};
module.exports = React.createClass({
renderScene: function(route, navigator) {
var Component = ROUTES[route.name];
return <Component route={route} navigator={navigator} />;
},
render: function() {
return (
<NavigationExperimental.Navigator
style={ styles.container }
initialRoute={ {name: 'login'} }
renderScene={this.renderScene}
configureScene={ () => { return NavigationExperimental.Navigator.SceneConfigs.FloatFromRight; } }
/>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1
}
});
Any one let me know to solve this issue
I've change the lines
configureScene={ () => { return NavigationExperimental.Navigator.SceneConfigs.FloatFromRight; } }
To
configureScene={ () => { return NavigationExperimental.Navigator.SceneConfigs.FloatFromRight; } }
Fix my issue
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