在我的react组件中,我在控制台中遇到了以下问题
index.js:1 Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. at Id (http://localhost:3000/main.82c936520e7a7
我正在使用ReactJS和谷歌FireStore创建一个简单的股票投资组合跟踪应用程序。如何在不触发警告"React Hook has a missing dependency“的情况下从useEffect中访问数据库函数?我尝试过使用useCallback,但到目前为止还没有成功。或者可以忽略这些警告?
var db = firebase.firestore();
useEffect(() => {
//get user's cost averages from db
if (props.userStatus) {
db.collect
我正在使用redux工具箱方法中的api获取数据。我正在控制台中获取数据,但是我的钩子在页面加载时没有更新。
在这里输入代码
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import { useNavigation } from '@react-navigation/native';
import { Calendar } from 'react-native-calendars';
这是一个常见的问题,但不知怎的,我已经尝试了我能找到的所有解决方案,但仍然收到了这个警告。
VirtualizedList: You have a large list that is slow to update - make sure your renderItem
function renders components that follow React performance best practices like
PureComponent, shouldComponentUpdate, etc. {"contentLength": 5200, "dt