-2
I’m having trouble putting on the screen a simple "main page" what’s wrong with the code? (no error appears in the console)
main.js file
import React, { Component } from 'react'
import { View, Text } from 'react-native'
export default class Main extends Component {
render() {
return (
<View>
<Text>Página Main</Text>
</View>
)
}
}
index.js file
import { AppRegistry } from 'react-native';
import App from './src';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
File Routes.js
import { createStackNavigator } from '@react-navigation/stack';
import Main from './pages/main'
export default creacteStackNavigator({
Main
})
How is your component
App
? And you are not creating the routes correctly, see the documentation ofcreateStackNavigator
– Rafael Tavares