Issue
So I'm trying to set up the navigation for a log in screen and I've tried relinking dependecies and installing packages all over again and I've only worked on two files. I am working on MacOS and simulating on iOS 13.5.
This is the complete error when trying to simulate.
App.js
import React, { Component } from 'react'
import {
StyleSheet,
View
} from 'react-native'
import Mystack from './navigators/StackNavigator'
export default class App extends Component {
render() {
return (
<NavigationContainer>
<Mystack/>
</NavigationContainer>
)
}}
const styles = StyleSheet.create({
container: {
},
})
and StackNavigator.js
import * as React from 'react';
import { createStackNavigator} from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import LogIn from './src/components/LogIn.js'
import SignUp from './src/components/SignUp.js'
import Dashboard from './src/components/Dashboard.js'
const Stack = createStackNavigator();
function Mystack() {
return(
<Stack.Navigator initialRouteName = "LogIn"
screenOptions = {{
headerTitleAlign: 'center',
HeaderStyle: {
backgroundColor: "#FFF700",
},
headerTintColor: '#FFF',
headerTitleStyle: {
fontWeight: 'bold',
},
}}>
<Stack.Screen name = "LogIn"
component = {LogIn}
options = {{
title: 'LogIn',
headerShown: false
}}/>
<Stack.Screen name = "SignUp"
component = {SignUp}
options = {{
title: 'SignUp',
headerShown: false
}}/>
<Stack.Screen name = "Dashboard"
component = {Dashboard}
options = {{
title: 'Dashboard'
}
}/>
</Stack.Navigator>
)
}
export default Mystack;
Solution
I am not sure is it proper solution or not but restarting package worked for me.
Answered By - Iva
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.