我正在尝试在 React Native 项目中使用 Firebase
我在我的项目中安装了 firebase:
npm install --save firebase
我将其导入到我的 app.js
import firebase from 'firebase';
import React, { Component } from 'react';
import {
Platform,
Text,
View
} from 'react-native';
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View >
<Text>Testando Firebase</Text>
</View>
);
}
}
然后显示错误:
Objects are not valida as a react child (found: object with keys{&&typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead.
但是当我从 firebase 中删除导入时,该应用程序可以完美运行。
最佳答案
尝试安装版本5.0.2。以管理员身份使用此命令:
npm uninstall firebase
npm install --save firebase@5.0.2
据我所知,当前版本(5.0.4)有错误!
关于firebase - 将 firebase 导入到 React-Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50800980/