我对 Javascript 还很陌生。所以请忍受我的乱码,但我不知道这个错误是什么意思,并且花了很长时间试图解决这个问题。我现在正在使用 Replit,但我也在 Visual Studio 上尝试过,但出现了同样的错误。请帮忙,我不知道该怎么办!每当我尝试运行我的脚本时,它都会出现以下错误:TypeError: Cannot read properties of undefined (readin
2022-04-04
我正在使用 react-native 构建电子商务应用程序,我刚刚遇到一个错误,我不知道它是什么意思错误是“可能未处理的承诺拒绝(id:0):TypeError:未定义不是对象(评估'err.response.data')”我在 2-3 个文件中使用了“err.response.data”,但我提到了一个文件的代码import AsyncStorage from '@react-native-co
2022-03-19
我已遵循了有关如何正确等待 ListFile() 函数数据的多个指南。我已将输出记录到 ListFile() 中的控制台,因此我知道数据是正确的。当我尝试等待函数完成并记录数据时,在尝试使用等待和承诺时,我得到了两个输出之一:getData error: TypeError: undefined is not an object (evaluating 'response.json')或Promi
2022-03-16
-React Native 中的应用开发-您好,我遇到了 Expo Camera 问题。当您想要拍照时,会出现错误。“TypeError:undefined 不是对象(评估“_this.camera = _ref”)”/Scan.js。如果应用程序刚刚使用 Expo 更新,则一切正常。但是,只要您继续编程并出现另一个错误,就会出现此错误,并且直到您再次刷新应用程序才会消失。我尝试了很多方法,但我需
2022-03-13
我正在开发一个必须从 Firestore 数据库获取新订单的应用程序,我使用componentDidMount每 10 秒刷新一次屏幕并启动fetchNewOrders函数,如果有新订单,该函数应将该对象推送到状态数组newOrder,并在下面的 FlatList 中显示订单。当我启动代码时,它返回错误TypeError: undefined 不是对象(评估'item.id'),我还编写了一个从数
2022-02-28
我正在使用 firebase 和 React Native 实现登录功能。handleLogin方法始终返回succeed()。如果我删除success(),我会得到:[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'result2.failed')]export default asy
2022-02-24
我尝试通过传递参数将数据发送到另一个页面,从页面 1 到页面 2。这是我从页面 1 发送的代码:axios({method: 'post',url: "http://127.0.0.1:8000/api/masuk",data: {username: {username}}}).then(function (response){if (response.data.data != null) {//
2022-02-17
有人能找出这段代码中有什么问题吗?从 flatlist 中什么也没得到。状态变量 items 也显示为 null。import React, { useEffect, useState } from 'react';import { FlatList, SafeAreaView, TextInput, Text, Button, Alert } from 'react-native';import
2022-02-14
我想在前端显示帖子详情。我的 api 显示的帖子详情如下,在 postman 中捕获:"message": "Posts fetched successfully!","posts": {"_id": "61f05f676793d49f466e7aaa","title": "Liberal Arts Student Sample","content": "The three-page.","cre
2022-02-06
我正在尝试在 React 项目中编写一段 JavaScript 代码。我有一个组件“expenses”,它通过 props 传递了一些数据。数据是一些对象的数组。这是我的代码:数据:const EXPENSES = [{ id: "e1", date: "March 2021 12", description: "New TV", price: "$780" },{ id: "e2", date:
2022-02-01
function Screen2({route, navigation}) {return (<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}><Text>{route.params.myText}</Text></View>);}export default Screen2;这里的 myText 是
2022-01-23
我遇到了一种有线情况,为此挣扎了一段时间。我已经使用 Firebase 实时数据库实现了应用内聊天,此解决方案在 Android 的实时重新加载模式和构建模式下均能正常工作,并且在 iOS 的实时重新加载(ionic cordova run ios -l --external)模式下也能工作,但在构建应用程序时不起作用。ionic cordova build ios我正在相同的设备和相同的代码上测
我在使用 Redux Toolkit 时遇到了问题。我想将一个称为 selectedData 的对象推送到我的初始状态,这是一个数组,这给了我错误“TypeError:undefined 不是对象(评估‘state.selectedData.push’)”。我一直在关注https://redux-toolkit.js.org/usage/immer-reducers,他们编写的 Reducer 逻
2022-01-05
我正在创建一个表单来更新应用程序后端的患者对象。当我提交表单时,它给了我“TypeError:无法读取未定义的属性(读取'firstName')”,然后显示此信息72 | && <p className={styles.errMsg} name="errMsg" data-testid="errMsg">{constants.API_ERROR}</p>}73 | {patient && (7
2022-01-02
我正在尝试使用 Constants.statusBarHeight 将视图与 react-native 中的状态栏分开,我使用expo install expo-constants安装了 Constants,但是我收到此错误:TypeError: undefined is not an object (evaluating '_expoConstants.Constants.statusBarHe
2022-01-02