• 如何在Material-UI表中显示动态数据?

    我有返回一些表格数据的API。我需要在表中显示这些数据。我不清楚如何实现此目标。 Let's assume that I want to display the fields id and name stored in groups. How can I show them in the Material-UI Table? 请在下面查看我当前的代码。它不会引发任何错误。但是都没有显示带有数据的表。 import '../../App.css'; import React, { useEffect } fr...
  • 实质性UI表分页不会更新页面更改上的列表

    我正在尝试使用MaterialUI Table在我的React应用程序中实现一个表。我正在使用“表分页”组件,并且页面更改处理似乎无法正常工作,更改页面时列表未更新。我能做什么? 在此先感谢您的帮助。不胜感激。 这是我的代码: const UserList = () => { const classes = useStyles(); const { isLoading, error, sendRequest, clearError } = useHttpClient(...
  • 从api提取数据到material-table-ui

    实现API提取后出现此错误 通过阿波罗查询 class Vehicles extends Component { state = { columns : [ { title: 'VIN', field: "VIN"}, { title: 'REGISTRATION_PLATE', field: 'REGISTRATION_PLATE' }, // { title: 'Contract', initialEditValue :'customer' , field...
  • 尝试在类组件中使用功能组件时出现错误

    我有两个主要组成部分。 Recipe.js组件是父组件,RecipeCard.js是子组件。我收到错误错误:无效的挂钩调用。挂钩只能在功能组件的主体内部调用。我不确定为什么会出现此错误。我希望我能对问题出在哪里有所了解。 Recipe.js: import React, { Component } from "react"; import AddRecipe from "./addRecipe"; import "./Recipe.css"; import { Route, BrowserRouter as...
  • 实质性的UI弹出框阻止了按钮功能-React.js

    这是Header.js,单击它时我有一个按钮(“反应符号”),它将更改页面主题。当您将鼠标悬停时,它具有一个弹出窗口,用于声明按钮的功能。使用此功能后,为什么我的按钮被禁用(我无法再单击它)? import React, { useState } from 'react' import ReactSvg from './reactSvg' import { Box, Typography, Link, Container, IconButton } from '@material-ui/core' impo...
  • 使用Material UI和ReactJS进行表单提交和验证

    我正在从AntD转到MaterialUI,无法弄清楚如何轻松实现表单验证和表单提交而无需重新加载整个页面。 As an example, upon clicking "sign in" the whole page reloads, which isn't a good idea with an SPA app. 我可以通过将handleFunction从元素移动到元素的onClick函数并从Button中删除type =“ submit”来避免重新加载整个页面,从而绕过它。可以,但是删除了验证,并且删除...
  • Index.js错误:UserForm(…):渲染未返回任何内容。这通常意味着缺少return语句。或者,不渲染任何内容,则返回null

    嗨,我还很陌生。我是个新手,我想在我的React应用程序中单击按钮添加一行。我点击了此链接如何在React.js中动态添加和删除表行 这样做,但是我无法将其翻译为我的代码。 我收到此错误。 错误:UserForm(...):渲染未返回任何内容。这通常意味着缺少return语句。或者,不渲染任何内容,则返回null。 Module../src/index.js D:/react_bpms1/src/index.js:7 4 | import App from './App'; 5 | import...
  • 实质Ui弹出框位置不正确

    I am working on a project of web application with react. Where I used material ui for navbar. there is a show more icon on right side for mobile devices. But when I open it the popover opened at left side and showing an error Material-UI: The anchorEl prop...
  • 反应不关闭对话框

    Im using materialUI to click a menu item that then opens a dialog box(child component) however after the dialogbox opens it wont seem to close and wont update the data for noticeModal. There are not any errors being thrown and i belive it has to do with us...
  • 材质ui函数的调用函数

    我想将一个函数作为道具传递给我的材料ui函数。 给定的函数在我的材料用户界面功能中未定义。 import React, { Component } from 'react'; import styled from 'styled-components'; import InputBase from '@material-ui/core/InputBase'; import IconButton from '@material-ui/core/IconButton'; import Menu from '@m...
  • 动态呈现表单元素并将其保存在ReactJS中的数组中

    我有3个materialUI TextField,要渲染n次(n是渲染表单字段之前用户的整数输入,这里我将其存储在名为groupMembersCount的变量中)。 我在ReactJS中使用功能组件,将useState挂钩定义为一个数组: const [groupDetails, setGroupDetails] = React.useState([ { fullName: "", phoneNo: "", gender: "" }, ]); 这将是我的主要数组,将所有3个值(用户输入)保存在...
  • ReactJS和Material UI CheckBox状态更改

    Im using Material UI Checkbox to create a form that takes input and then in theory adds the new values or updates the values into a state object. This form is used for both editing a holiday or creating a new holiday. 我正在努力寻找为什么在单击复选框或在输入框中键入内容后不会更新我的状态的原因...
  • 我的react-admin捆绑包很大(860KB)

    我已经尝试配置各种不同的优化方法,但是我的react-admin软件包大小仍然很大,为860KB。 我该怎么办?正常吗可能是什么原因?我将在一分钟内用我的webpack配置发布链接。 我认为目前尚无任何聪明的方法来进行代码拆分。我实施的资源很少,应该始终将它们一起使用。 Link to my common webpack config: https://pastebin.com/t6uMWiJ6 const path = require('path'); const webpack = require('w...
  • React Router / Hook的问题

    我是一个崭新的反应者,最近我在尝试单击卡媒体(使用材料ui)导航到页面时遇到了此错误。因此,我几乎按照说明进行操作,以通过历史记录推送到我想通过功能导航到的页面的路线,并在单击媒体卡时调用该功能。下面是我的代码和我得到的错误。您知道为什么我可能对此有疑问吗? 这是我得到的错误: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of...
  • 使用Material UI的React Router

    我是个新手,现在我想同时使用React Router和Material UI。 我有一个布局文件,它使用材料UI中的导航抽屉,并且将菜单放在左侧,内容放在右侧,如下图所示。 What I want to do is, when I click on the Test Comp it should load the TestComp.js component on the right and so on for Test Comp One to load TestCompOne.js. 我已经使用链接,开关和...
  • react-router-dom和material ui:forwardRef问题

    尽管我已经按照几篇文章和material-ui网站示例中的说明应用了forwardRef,但是在控制台中仍然有警告。我真的不明白为什么。 我正在尝试创建带有项目列表的抽屉,这些项目是嵌入到Material-UI链接组件中的react-router链接。我嵌入它们是为了受益于我创建的全球MUI主题 PS:这是一个打字稿代码。引用强类型是一个地狱;-) HERE IS CODESANBOX TO REPRODUCE THE ISSUE. Make sure to extend enough the codesa...
  • 在基于类的组件中初始化react钩子

    我试图将基于功能的组件更改为基于类的组件。转换时出现错误。如何在类组件中初始化钩子。 错误:无效的挂钩调用。挂钩只能在功能组件的主体内部调用。可能由于以下原因之一而发生: 1.您的React和渲染器版本可能不匹配(例如React DOM) 2.您可能违反了《钩子规则》 3.您可能在同一应用程序中拥有多个React副本 This is the error I am getting Papebase材质用户界面 import React from 'react'; import PropTypes from '...
公告

欢迎访问 goshare  点击这里设置您的邮箱  可以接收站内跟帖、回复邮件提醒,不错过任何一条消息。

关注公众号订阅更多技术干货! 魅力技术资源分享