我遇到了一些困难,使我的代码正常工作。我正在使用交互式地图上的工作,我想添加一个函数,当用户“双击”允许他们添加标记时,该功能应该从地图本身中拉长和lat。<< P>我对使用该功能的部分有:170086711,这是我写下我的功能的地方:328807926这是我调用函数的地方:716882999该应用程序运行良好,但是当我双击时什么也不会发生。如果我在浏览器中打开控制台,我每次双击时都会收到此错误:
2022-05-03
我正在尝试使用 jest 测试 React TypeScript 项目,但它给出了一个令人困惑的错误:这是我的 package.json:"dependencies": {"@testing-library/jest-dom": "^5.16.4","@testing-library/react": "^12.1.5","@testing-library/user-event": "^13.5.0
2022-05-02
我已成功获取产品。但当我在控制台日志中看到它显示 null,然后显示 10 个产品的数组。const [datas,setDatas]=useState(null);const [loading,setLoading]=useState(false);useEffect(()=>{fetch('products.json').then(result =>result.json()).then(da
2022-05-02
我正在开发一款可以执行 CRUD 操作的 MERN 堆栈应用。但更新似乎不起作用。执行更新操作时,我可以在浏览器控制台中看到更新的值,但它似乎没有更新数据库中的值,并且不断出现我在标题中提到的错误。提前致谢。import React, {Component} from 'react';import axios from 'axios';import Sidebar from '../../comp
2022-04-30
我想使用 google-map-react api 包含一张地图,但总是出现以下错误:google_map.js:428 Uncaught TypeError: Cannot read properties ofundefined (reading 'emit')at o.r.componentDidUpdate (google_map.js:428:1)at commitLayoutEffect
2022-04-29
我按照教程为我的表格添加页面分页,现在我的浏览器中出现了这个错误:Uncaught TypeError: Cannot read property 'main' of undefinedat ButtonRoot.ownerState.ownerState (Button.js:80)at transformedStyleArg (createStyled.js:189)at handleInte
2022-04-28
我试图在实例化智能合约后立即使用它。但是,我收到错误:Uncaught (in promise) TypeError: Cannot read properties of null(reading 'call')我以为在实例化智能合约后我无法访问函数,但似乎不是这样。还能是什么?有人已经遇到过类似的问题吗?当前代码:import React, { useEffect, useState } fro
我试图从 commerceJS API 访问从不同模块获取并作为 prop 传递的数据,只有当我调用嵌套产品对象时,代码才会中断,并出现此错误 Uncaught TypeError: Cannot read properties of undefined (reading 'source')。这是我的代码//Product.jsximport React from 'react';import {
2022-04-26
我正在处理的一个 React 项目出现此错误“Expenses.js:8 Uncaught TypeError: 无法读取未定义的属性(读取‘Items’)”,我不知道为什么我总是收到此错误。我对 REACT 完全陌生。任何帮助都非常感谢这是我的文件代码App.jsimport Expenses from "./components/Expenses";function App() {const
2022-04-25
我遇到如下问题:class App extends React.Component {testop(){alert("test");}showAlert() {// alert("Im an alert");this.testop();}render() {return <button onClick={this.showAlert}>show alert</button>;}}运行代码时,出现错
2022-04-24
我想向 react-admin 添加一条确认消息,例如“您想删除项目吗?”。因此,我尝试使用<DeleteButton />和undoable={false>选项以及<DeleteWithConfirmButton />组件。但是它们两个都一直发生这样的错误。Uncaught TypeError: Cannot read properties of undefined (reading 'toLo
2022-04-20
我编写了以下代码来将值传递给信息框,但我收到错误未捕获的 TypeError:无法读取未定义的属性(读取“0”)。请告诉我错在哪里。import React,{useState} from 'react'function App() {const [specificState, setSpecificState] = useState({});const jsondata1 = await fet
2022-04-18
我从 localstorage 获取数据。我使用了 useEffect。但是当我想获取对象中的值时,我遇到了问题。const [carinfo, setCarInfo] = useState();useEffect(() => {const storedData = JSON.parse(localStorage.getItem("carData"));setCarInfo(storedData)
2022-04-16
我的代码有什么问题?在页面重新加载后访问 mydata.daily confirmed 时出现错误?const[state,setState]=useState({});async function getApiIndia1(){const temp=await fetch('https://data.covid19india.org/data.json')const mydata=await t
2022-04-14
我尝试从来自 useState 钩子的数组中返回 div 中的 p,但出现此错误:Uncaught TypeError:无法读取未定义的属性(读取“items”)Imagefunction App(){const [items, setLab] = useState(["a", "b", "c"])console.log(items)return (<div> laberinto{this.ite
2022-04-14