开发者问题收集
我正在使用 react js 上传单个文件。但是 multer.single() 不起作用,而 multer.array() 起作用。问题是什么?//Node.jsconst upload = multer({storage: multer.diskStorage({destination: './uploads',filename: (_, file, cb) => cb(null, file.
代码似乎没问题,但出现了这个错误。它说 TypeError:无法读取 React 项目中 null 的属性“length”。我已将代码发布在下面。我正在使用 React Js 来构建它。请帮忙。import React, {useEffect} from 'react'import { Link } from 'react-router-dom'import { useDispatch, useS
我有一个如下所示的类组件:interface MyState {x_array: number[]y_array: number[]order_graph_1: number}class ItemsContainerOld extends React.Component<MyProps, MyState> {constructor(props: MyProps) {super(props)this
我正在开发一个页面,该页面从 API 获取数据并使用 Material UI 和 Datagrid 组装表格。我的目标是将数据解析到表格中。我的数据看起来像这样{id: 1,device_mrid: "xxx1",canaryDeviceId: "xxx",},{id: 2,device_mrid: "xxx2",canaryDeviceId: "xxx",},{id: 3,device_mrid
我有一个 api,我想从中显示数据,我有 2 个数组,每个数组都有一个类别,我将如何迭代并显示这两个类别,即艺术类别和娱乐类别。我尝试了一些方法,但没有奏效,它给出了这个错误TypeError:无法读取未定义的属性“map”,非常感谢您的帮助。提前致谢import React,{useState, useEffect} from 'react'import './Home.css'import B
大家好,我有一个项目,它从 API 获得响应,然后将数据从父级传递到子级。问题是,我可以轻松访问顶层的响应,但当我尝试进入 API 的内部部分(在本例中为price={statistics.quotes.USD.price)时,我收到了TypeError: Cannot read property 'USD' of undefined错误。我尝试使用 console.logging 价格来检查我的
当我从 API 获取数据时,会发生此错误。TypeError: Cannot read property 'length' of undefined以下代码代表我的项目的主页。我想在主页上显示 20 个数组项。App.jsimport React, { useState, useEffect } from "react"import banner from "./assets/marvel-gro
我正在使用 TMDB API,它允许我在列表中显示电影。我有 Add.js 组件,它允许我进行查询和搜索电影并将它们添加到我的列表中但是我收到此错误:TypeError: Cannot read property 'length' of undefinedAdd.jsimport React, { useState } from "react";import { ResultCard } from
我有这个数据集,其中包含amenities,它也是对象中的对象:{name: "California Maki Resort",price_per_night: 2804.0,description:"On a lush 16-hectare island with white-sand beaches, this relaxed resort is 5 km from the jetty in
当访问 commerce js 中 cart 对象的 line_items 数组时,出现错误,提示未定义,但我仍然可以在控制台中看到它。以下是一些截图:错误:TypeError: Cannot read property 'length' of undefinedCartD:/Zayeed/Projects/e_commerce/src/components/Cart/Cart.jsx:74 |5
我在使用“react-dom/server”中的renderToString在 SSR 上渲染某些 URL 时遇到一些错误我收到以下错误:TypeError: Cannot read property 'length' of undefinedat areHookInputsEqual (C:\projects\spd-web-app1\node_modules\react-dom\cjs\rea
我尝试了 Material UI 中的自动完成示例。它是关于输入新值时添加选项。以下是演示的链接:https://codesandbox.io/s/material-demo-forked-lgeju?file=/demo.js我想知道的是,输入中的值实际上并未添加到此示例中的选项中,因此它实际上不起作用。为什么会这样?此外,我不能将它用于多选(通过将属性“multiple”添加到自动完成),因为
我是实施身份验证的新手,对如何解决我遇到的问题有些困惑。我正在构建一个 React 应用,并希望登录的用户能够通过GigRegister组件将数据提交到 Firebase 数据库。但是,当我尝试提交信息时,出现以下错误:TypeError: Cannot read property 'getIdToken' of null关于如何解决这个问题,您有什么想法吗?这是登录页面的代码(登录后重定向到 G
错误代码 :TypeError: Cannot read property 'map' of undefinedPatientInfoModalD:/test/pages/patient/PatientInfoModal.js:164161 | </Form.Item>162 |163 | <Form.Item name={['patie
我的react 应用中的 RandomName 组件出现错误“TypeError: 无法读取未定义的属性‘length’”。我做错了什么?import React, { useState } from 'react';import ReactDOM from 'react-dom';function RandomName(props) {const [name, newName] = useSta