firebase - 将 firebase 导入到 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>
);
}
}
然后显示错误:
对象不能作为反应子项进行验证(找到:带有键{&&typeof、type、key、ref、props、_owner、_store}的对象)。如果您打算渲染一组子项,请改用数组。
但是当我从 firebase 中删除导入时,该应用程序运行良好。
解决方案
尝试安装 5.0.2 版本。以管理员身份使用此命令:
npm uninstall firebase
npm install --save firebase@5.0.2
据我所知,当前版本(5.0.4)有问题!
推荐阅读
- apache-spark - 用于 spark 结构化流的自定义接收器
- html - 当我使用导航栏导航到该部分时,我的标题超过了该部分的第一个 114.19px?
- r - 传单闪亮的调色板问题
- python - 在 pytorch 和 keras 中保存模型
- docker - docker-compose:使用詹金斯将所有图像推送到人工服务器?
- java - 当被菜单项或工具提示遮挡时,JPanel 绘制方法行为异常
- html - 通过 POST 请求发送默认值.Django,HTML
- sql - 递归选择运行缓慢
- node.js - Heroku env 变量在节点 js 中工作,但不是 React
- c# - 如何在一定时间后删除我的克隆对象?