In my code here, I am trying to create a Stack Navigator.
This is the stack navigator I have made.
import React from 'react';import { View, Text, StyleSheet } from 'react-native';import { createStackNavigator } from '@react-navigation/stack';import EnterPassword from '../screens/EnterPassword';import EnterAccount from '../screens/EnterAccount';const GoogleLoginStack = createStackNavigator();const GoogleLogin = () => { return (<GoogleLoginStack.Navigator><GoogleLoginStack.Screen name='EnterAccount' component={EnterAccount} /><GoogleLoginStack.Screen name='EnterPassword' component={EnterPassword} /></GoogleLoginStack.Navigator> )};export default GoogleLogin;
It is then used in App.tsx file where:
...<Stack.Screen name="Login" component={Login} /><GoogleLogin /><Stack.Screen name="SignUp" component={SignUp} />...
The screen I have created is as follow:
import React from 'react';import { View, Text, StyleSheet } from 'react-native';const EnterAccount = (props: any) => {<View style={styles.screen}><Text> Enter Account Screen</Text></View>}const styles = StyleSheet.create({ screen: { flex: 1, justifyContent: 'center', alignItems: 'center', }})export default EnterAccount;
However, I am getting this error:Error text: https://i.stack.imgur.com/zKbAa.png
I understand that it is because of how I defined the type of props to be but I am unsure of what's the right way to define the type of props.
Thank you so much for your help!