I have upgraded react-native to 0.44 and I have seen that Navigator is deprecated.
I have already install and import from 'react-native-deprecated-custom-components' but I get this error:
Element type is inalid: expected a string (for build-in components) but got: object.
Check the render method of 'TestApp'.
import React, {Component} from "react";
import {AppRegistry, StatusBar, StyleSheet, View} from "react-native";
import Navigator from "react-native-deprecated-custom-components";
import Root from "./root";
export default class TestApp extends Component {
renderScene(route, navigator) {
console.log(route);
if (route.name === 'root') {
return <Root navigator={navigator} />
}
}
render() {
return (
<View style={styles.container}>
<StatusBar animated/>
<Navigator
initialRoute={{name: 'root'}}
renderScene={this.renderScene.bind(this)}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#eeeeee',
},
});
AppRegistry.registerComponent('TestApp', () => TestApp);