我在react应用程序中安装了firebase,并像下面这样初始化
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAuth, GoogleAuthProvider } from "firebase/auth"
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.
我正在写这份时事通讯,它使用用户的全名、电子邮件和电话号码。每次我尝试提交信息时,我都会得到这个错误->
Uncaught TypeError: _firebase__WEBPACK_IMPORTED_MODULE_2__.default.collection is not a function
at submit (Newsletter.jsx:13:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4157:1)
at Object.invokeGuardedCallbackDev
我已经在Firebase中安装了带有npm的Firebase,但是我不知道这个错误会发生什么。
文件FIREBASE.js
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
我有一个react.js项目。我使用react 360来生成360度的外观。我想将数据从firebase导入到我的client.js中。数据位于我的文件firebaseData.js中。所以当我尝试用
import * as firebaseData from 'firebaseData/firebaseData.js'
我的整个应用程序崩溃了。有什么建议吗?这条路应该很好。
我的firebase.js文件:
import * as firebase from 'firebase'
var config = {
apiKey: 'xy',
我不知道这里的错误是什么。我制作了教程Firebase/网站,并在我的项目中做了同样的事情。我试图在我的React网站上打印出我在Firebase上创建的集合,但在db.collection:Uncaught (in promise) TypeError: ae.collection is not a function行得到了错误 component.js: // React
import { useState, useEffect } from "react";
import { db, collection, getDocs } from '../../../f
我正在制作一个食品递送应用程序,使用的反应-本地和redux。我想从防火墙存储中获取数据,为此,我在actions.js中编写了一个函数,但是每当我运行该应用程序时,它都会显示错误。
Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
下面是我用来获取数据action.js的函数
import firebase from "firebase"
export const ProductDetails = (d
你好,为了测试的目的,我想把我的app.js文件转换成一个组件,这样我就可以把它呈现在一个不同的文件中,这个文件就是我的新app.js。如何将此代码转换为react中的组件?
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import LoadingScreen from './LoadingScreen';
im
我第一次尝试在React应用程序上使用firebase,但我在文档中找不到正确的过程。
这是我的config.js用于防火墙(当然,在这里,我已经隐藏了我的凭证)
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
// TODO: Add SDKs for Firebase products that you
遇到了一个很奇怪的问题。当试图导入firebase时,我得到了以下错误:
./node_modules/firebaseui/dist/esm.js
Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase').
我的项目的结构是:包含react客户端文件夹的父文件夹。我在父文件夹中安装了firebase,在父文件夹中的firebaseConfig文件中初始化了一个firebase应用程序,然后将它导入到react文件夹中。
后
我正在考虑使用Vuefire来使Firestore与我的Vue项目集成变得更容易。在读取getting started documentation时,他们会让您创建一个db.js文件,以便您可以“方便地”将其导入到项目中的任何位置。 import firebase from 'firebase/app'
import 'firebase/firestore'
// Get a Firestore instance
export const db = firebase
.initializeApp({ projectId: 'MY PROJECT
App.js
import { useState, useEffect } from "react";
import "./styles.css";
import { Button, TextField } from "@mui/material";
import List from "./List";
import db from "./firebase.js";
export default function App() {
const [todos, setTodos] = useState([]);
我正在尝试在我的react原生项目中初始化firebase。
我正在初始化的App.js代码是
import React, {Component} from 'react';
import {View, Text} from 'react-native';
import {Provider} from 'react-redux';
import {createStore} from 'redux';
import reducers from './reducers';
import firebase from &
Error: While trying to resolve module `firebase` from file `/Users/---i/Desktop/mapnav/database/firebase.js`, the package `/Users/---/Desktop/mapnav/node_modules/firebase/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/
正在尝试使用react使用firebase.firestore。下面是我初始化firebase的方法。
import React, { Component } from 'react'
import { Provider } from 'react-redux'
import store from './redux'
import Routes from './Routes'
import initFirebase from './initFirebase'
class App extends Compon
因此,我在“相似的问题”中尝试了一些方法,但没有运气,因此我做了一个新的问题。
我有两个文件,
1: firebase.js:
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import "firebase/firestore";
import "firebase/auth