我刚接触React钩子,但我正在尝试使用带有useCallback的useEffect,但得到了臭名昭著的React Hook "useList" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function react-hooks/rules-of-hooks错误。
此文件包含makeRequest:
function useConnections = () => {
con
我在控制台中得到一个错误,如
错误!![错误:无效的钩子调用。钩子只能在函数组件的主体内调用。这种情况的发生有以下原因之一:
您可能有React的不匹配版本和呈现器(例如renderer ),您可能违反了Hooks的规则,在同一个应用程序*中可能有多个app副本。
import firebase from '../../database/firebase';
import { useDispatch } from 'react-redux';
import * as actions from "../../store/actions&
我正在尝试从firebase下载用户配置文件,并在组件中使用它们。我在使用异步firebase函数和useState时遇到了问题。在下面的代码中,“profile”被重复地连接起来,但它似乎没有更新Swiper组件中的“card”属性,它仍然得到一个空数组。 import * as React from 'react';
import Swiper from 'react-native-deck-swiper'
import { Card } from '../components/Card'
import { View } from '
我有一个错误,上面写着Can't import 'UseSelector' from react-redux。我正在做的是一个名为“入门”的小项目--我正在使用firebase并对此做出反应,下面是出现错误的代码文件
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './s
我正在努力弄清楚如何从我的react应用程序中的云防火墙数据库中提取数据,并尝试使用。
我目前正在尝试以下几种方法。
import React, { useState } from "react";
import { Link } from 'react-router-dom';
import { useStateMachine } from "little-state-machine";
import updateAction from "../../projectForm/updateAction";
import { use
在我的react应用程序中,我试图使用react-router-dom实现公共和私有路由。
我目前正在从firebase.auth().onAuthStateChanged()函数获得身份验证状态。
问题是,由于firebase.auth().onAuthStateChanged()函数是异步的,所以JSX块首先用authState of false呈现,然后firebase.auth().onAuthStateChanged()在返回JSX之后将authState设置为true。
因此,身份验证是正确的,但我的react应用程序停留在登录页面上。
PublicRoute.js
const P
我想从Firebase存储中获取项,并将它们设置为状态。我可以从哪里导入IDE推荐我使用的类型"Reference“?
const ListOfFiles: React.FC = () => {
// Using "react-redux-firebase"
const firebase = useFirebase()
// My question is concerning about what type to put here and where to take it from
const [items, setItems] = React.
在React Navite中,我保存了一组来自Firebase的值,并为每个值呈现视图。我不能从render()函数内部获取值。没有任何问题的例外,数组只是在render()中是空的。我不认为这是正常的行为,这能被修复吗? 下面是我的代码: import React from 'react';
import { StyleSheet,Text, View, ScrollView } from 'react-native';
import _ from 'lodash'
import * as firebase from 'firebas
当我在后台收到通知时,我尝试用apollo-hooks和react-native-firebase从服务器获取数据。
我创建了新的函数和registerHeadlessTask。
但它发生在Hooks can only be called inside the body of a function component.上
react-native: 0.59.8 react-native-firebase: 5.5.6 react-apollo-hooks: 0.4.5
我尝试使用react-apollo-hooks获取数据,但出现错误。而且,我得到了另一个上下文的自定义钩子,它也发生了Hoo