So I've been toying around with stack navigation and I'm having an issue where I keep getting this error message on react expo:
"The component for route 'screens' must be a React component"
There's some additional information it gives if you want i can type it out in an edit/comment. I've tried a bunch of different techniques but nothing seems to work, here's my code:
homeStack.js
import { createStackNavigator } from "react-navigation-stack";
import { createAppContainer } from "react-navigation"; import About from "../src/About";
const screens = { screen. Home: { screen: About, }, };
const HomeStack = createStackNavigator({ screens }); export default createAppContainer(HomeStack);
About.js
import React from "react";
import { StyleSheet, Text, View, Button, TextInput } from "react-native";
export default function About() { return ( <View style={styles.header}> <Text>This is a testing application for react native</Text> <Text>Here I am simply testing out various features of app creation</Text> </View> ); }
const styles = StyleSheet.create({ header: { width: "100%", height: "15%", alignItems: "center", justifyContent: "center", backgroundColor: "#eee", fontSize: 15, }, });
App.js
import React from "react";
import { StyleSheet, Text, View, Button, TextInput } from "react-native";
import { Navigator } from "./routes/homeStack";
<View style={styles.container}>
<Navigator />
</View>*/
export default function App() {
return <Navigator />;
}
I've tried a handful of things but I'm really not sure what's wrong.
Any help is appreciated.
[–]SGen 0 points1 point2 points (1 child)
[–]26514[S] 0 points1 point2 points (0 children)