小编fig*_*ghg的帖子

对象无效作为React子对象(找到的对象:带键的对象($$ typeof,type,key,ref,props,_owner,_store})

我正在尝试在我的本机应用程序上使用firebase.但它给出了一个错误. 图像在这里

我的App.js代码如下

import React, { Component } from 'react';
import { Text } from 'react-native';
import firebase from 'firebase';

export default class HelloWorldApp extends Component {
  componentWillMount(){
    firebase.initializeApp({
      apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
      authDomain: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
      databaseURL: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
      projectId: 'xxxxxxxxxxxxxxxxxxxx',
      storageBucket: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      messagingSenderId: 'xxxxxxxxxx'
    })
  }

  render() {
    return (
      <Text>Hello world!</Text>
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

我能做什么?谢谢

firebase ecmascript-6 react-native react-native-android

6
推荐指数
1
解决办法
3551
查看次数