开发者问题收集
我是 React 新手,我创建了这样的组件;export default class CartoviewDrawer extends React.Component {constructor(props) {super(props);this.state = {open: false};}_handleToggle() {let open = this.state.open;this.setSta
我想将material-ui与reactjs一起使用。当我想渲染FlatButton时,我收到此错误:TypeError:_context$muiTheme未定义我是reactjs新手,我不知道可能是什么错误。这是我的代码:import React, {Component} from 'react'import { Alert, Button, Jumbotron, Form } from 'r
我试图将 Material-Ui 中的 BasicTable 函数放入我的 React.js 文件中。这是我的代码。 import React, { Component } from 'react';import { Route, Redirect, Switch, Link, HashRouter} from 'react-router-dom';import firebase, { auth,
我使用 Material UI 1.0.0-beta.35 中的Tabs、Tab和Appbar来显示一些带有从包含数据的对象导入的标签的选项卡。我从 Material UI 收到此错误:Warning: Material-UI: the value provided `undefined` is invalid我可以在此codesandbox(Material UI 1.0.0-beta.38 但
因此,我尝试在我的 React 应用中使用 Material UI。我尝试使用 Material UI 版本 0.20.1 和 0.20.0,但收到此错误消息TypeError: Object(...) is not a function它指向此行export default withStyles(styles)(NavBar);我只是想创建一个导航栏,我尝试了很多方法。包括从文档中复制,但似乎不
我在 Windows 10 x64 b 中尝试webpack应用程序时收到以下错误。ERROR in ./node_modules/material-ui/styles/withStyles.jsModule not found: Error: Can't resolve '@babel/runtime/core-js/map'我在github和stackoverflow上搜索,但没有找到合适的答
我尝试从@material-ui/[email protected]切换到 Material 的最新当前版本v4.4.3,但出现了此错误我不清楚这个问题发生在哪段代码中以及如何修复它。也许有人对此有一些想法?此外,您可以在 package.json 文件中检查我的所有依赖项。如果您不清楚,请告诉我您需要哪些信息,我会将其附上。"dependencies": {"@babel/runtime": "
我开始在 react 和material ui 中开发一个新应用程序,遇到了一个问题:Error: React.cloneElement(...): The argument must be a React element, but you passed undefined.因此我还没有编写任何逻辑代码,我刚刚开始使用 react 和material ui。这个问题的解决方案和指导将非常有帮助。这
我在 handleChange 上收到此错误。我想知道问题是什么? const [testState, setTestState] = useState({activeStep:0,firstName: '',lastName: '',email: '',occupation: '',city: '',bio: ''});const { activeStep } = testState;const
当我在搜索栏上搜索时,出现无法读取属性值等错误,为什么会出现此错误,之前我做了很多表单,但没有出现此错误,请告诉我为什么会出现此错误,我应该使用 Material UI 而不是 Bootstrap 替换吗Music.js这是我出现错误的 music.js 文件,我使用 react-hooks 来管理状态import React, { useState } from 'react';import {
我正在学习 ReactJS,但我偶然发现了这个我无法弄清楚的错误。我想从其子组件更改父组件的items数组状态。我尝试将addItem函数作为 prop 传递给children组件,在输入时,子组件调用此函数并传入输入值。当我尝试在 addItem 方法中console.log(this.state.items)时,出现此错误。Uncaught TypeError: Cannot read pro
我有一个子组件,我需要通过 props 向其传递一个对象,并在该对象内的数组中找到索引值。如果您查看下面的代码,它相当简单。我收到此错误:TypeError: Cannot read property 'My_Items' of null我尝试过以多种不同的方式初始化“My_Items”数组,但仍然收到错误。如何从 IndexComponent 访问该数组中的这些值并避免此错误?import Re
我想在新的 state prop 中访问 state/property 的值。实际上,我已经有了 state 属性,其中存储了 Item=5 的值,并且创建了 UrlParam,其中存储了 URL,但我需要 URL 属性中的 Item 数值。我是 React 新手,有人可以帮我吗?当我收到错误TypeError: Cannot read property 'Item' of undefined时,
因此,我正在尝试使用 react 和 express 构建购物车。后端运行良好。我正在使用 postman 测试我的端点,它给了我正确的响应。然而,是 react 前端导致了问题。我正在尝试在已设置为服务器响应的items数组上使用map函数,但它给了我一个错误:TypeError: Cannot read property 'map' of undefined这是我的代码:Cart.jsimpo
我在使用 API 的 JSON 中的特定项目信息时遇到问题。当我想要放置我需要的字段时,它会引发错误:TypeError: Cannot read property 'item' of undefined -.当我想将字段放在里面时会发生这种情况return (*value*).但如果我将其放在返回之外并在控制台中显示它就可以工作。import React, { useState, useEffe