React Native Invariant Violation: View config

后端 未结 2 822
渐次进展
渐次进展 2020-12-08 04:27

I\'m trying to practice with different screens on a React Native project. Here\'s my code from App.js file.

import React, { Component } from \'react\';
impor         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 05:09

    In react native the component's name should begin with capital letter, so it will be:

    const Navigation = StackNavigator({
        Home: { screen: HomeScreen },
    
    });
    

    and call it with capital:

    export default class App extends Component<{}> {
      render() {
        return ;
      }
    }
    

提交回复
热议问题