This problem has already been addressed, but in my case it seems to be of a different type.
App.js Code:
import React, {Component} from 'react';
import { AppRegistry,StyleSheet, Text, View} from 'react-native';
export default class MainApp extends React.Component{
static navigationOptions = () => ({
title: "Home",
headerTintColor:"white",
})
render(){
return(
<View>
<Text>Hello World !</Text>
</View>
)
}
}
I have import react native elements and react navigation as libraries using yarn.