React-Native: Application has not been registered error

后端 未结 23 2156
無奈伤痛
無奈伤痛 2020-12-22 18:55

I am currently going through the React-Native tutorials. I began with the Getting Started tutorial, where I made a new react native project and successfully managed to run t

23条回答
  •  失恋的感觉
    2020-12-22 19:20

    This solved it for me

    AppRegistry.registerComponent('main', () => App);
    

    So my index.js file

    import { AppRegistry } from 'react-native';
    import App from './App';
    AppRegistry.registerComponent('main', () => App);
    

    And my package.json file:

    "dependencies": {
        "react": "^16.13.1",
        "react-dom": "~16.9.0",
        "react-native": "~0.61.5"
    },
    

提交回复
热议问题