0

I checked this question undefined is not an object (evaluating 'RootComponent.prototype') for the error but I could not solve it. There is probably one wrong import but I can not see what is wrong here.

App.js

import React, { Component } from 'react';
import FirstPage from './src/components/FirstPage/firstPage';

import { createStackNavigator } from 'react-navigation'; 

export default class App extends Component {
  render () {
    return <AppStackNavigator/>;
  }
}
const AppStackNavigator = createStackNavigator ({
    FirstPage: {screen: FirstPage},
    //SecondPage: {screen: SecondPage},

});

Index.js

import {AppRegistry} from 'react-native';
import { App } from './App';
import {name as appName} from './app.json';
import React from 'react';


AppRegistry.registerComponent(appName, () => App);

0 Answers0