Reputation: 64
import React, {Component} from 'react';
import {View} from 'react-native';
import { createStackNavigator,createAppContainer } from 'react-navigation';
import Splash from './Components/Splash';
import MainScreen from './Components/MainScreen';
const BasedNavigator=createStackNavigator({
Splash:Splash,
MainScreen:MainScreen,
},
{
initialRouteName: 'Splash',
}
)
const Container=createAppContainer(BasedNavigator);
class App extends Component {
render() {
return (
<View style={styles.container}>
<Container />
</View>
);
}
}
const styles = {
container: {
flex: 1,
},
};
export default App;
when i add react [email protected] it start crashing..i m using before [email protected] it work correctly for me before,after @4.02 now i don't understand why it does not work
Upvotes: 0
Views: 742
Reputation: 1496
I got the same error after using the modules
"react-native-gesture-handler": "^1.6.0",
"react-native-reanimated": "^1.7.0",
"react-native-screens": "^2.0.0-beta.8",
Please try
$ react-native link react-native-gesture-handler
$ react-native link react-native-reanimated
$ react-native link react-native-screens
the solution is working for me.
and the other reason can be
Upvotes: 0
Reputation: 792
There is some migration in version 4.
For example, createStackNavigator migrated to the react-navigation-stack library.
You have to read the document again :)
https://reactnavigation.org/docs/en/getting-started.html
https://reactnavigation.org/docs/en/hello-react-navigation.html
Upvotes: 1