Unhandled JS Exception: getPropertyAsObject: prope

2020-07-11 07:45发布

问题:

I've been having errors after errors to the point where I've reset my Metro Bundle and performed updates, errors from required module "699" to "700" have been coming up and now this. I believe I have all the required dependencies for Drawer navigator and ionicicons but errors continue to persist. I have code written in different files but below is the one written in App.js. Feel free to ask for the other ones in order to solve the issue at hand.

import React from 'react';
import {
  View,
  Text,
  StyleSheet

} from "react-native" ;

import  DrawerNavigator  from './Menu/DrawerNavigator';
import SettingScreen from './Menu/SettingScreen'

export default class App extends React.Component {

  render(){

    return (
<View style ={style.container}>
  <SettingScreen/>
  </View>


    );
  }
}


style = StyleSheet.create ({

  container: {
    flex: 1,
    justifyContent: 'center',


  },
});

回答1:

For mac,

I have this error, I believe that you have npm install/yarn add a new package and you will require to Ctrl+C to exit the Metro Bundler and restart again. The error/issue will be solved.



回答2:

For Windows,

I got the same error, what I did is

  1. close your local-cli windows(picture attached)
  2. uninstall the app from your device/emulator(there can be two apps with the slight change name of theirs).
  3. run again the with react native command like 'react-native run-android'
  4. I tried to reproduce it after these steps but I wasn't able



回答3:

For Windows 10: Restarting the Metro Bundler by pressing ctrl + c and then expo start will fix this issue.