在浏览器上运行项目时出现了以下错误:
未能编译:
./node_modules/@material-ui/lab/esm/internal/svg-icons/Close.js
Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'.
我正在尝试实现 (来自“多值”部分中的示例)。
下面是我使用的代码:
import React from 'react';
import Chip from '@material-ui/co
我是新来的网站,这是我的第一条评论。我有一个我无法解决的问题。我刚开始反应,我构建了一个组件,它从redux获得一个名为类别的数组。
我想将这个数组作为列表打印给用户。
这就是我想要做的,但我得到了错误。
错误:太多的重呈现。React限制呈现的数量,以防止无限循环。
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import List from '@material-ui/core/List';
import ListItem
试图使用材料Ui实验室的复选框。但是,在npm安装了三个依赖项:@material-ui/lab、@material-ui/core和@material-ui/icons之后,我收到了以下错误:
./node_modules/@material-ui/core/esm/Portal/Portal.js Attempted import error: 'HTMLElementType' is not exported from '@material-ui/utils'.
我的进口商品如下:
import React from 'react';
im
? 我使用内部带有Icon的Material-UI TextField,如下所示。"Your good name here“的标签应该放在图标旁边,而不是重叠。 在我将InputLabelProps={{ shrink: false }}添加到TextField之后,就会发生这种情况。 我怎样才能正确地定位这个位置?有什么帮助吗! 提前感谢!=) This is my code pen import React from "react";
import { makeStyles } from "@material-ui/core/styles"
我使用以下代码,但当我在框中键入文本时,它显示错误,没有提供太多信息。我的目标是能够在文本框中键入和显示文本。 import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import CardMedia from '@material-ui/core/CardMedia';
import { withStyles } from '@material-ui/core/styles';
import CardActi
通过阅读资料-ui文档和在线示例,似乎有不同的方法来导入相同的项目: import TextField from 'material-ui/TextField';
// or
import TextField from '@material-ui/core/TextField';
// or
import { TextField } from '@material-ui/core'; 不同的导入方式有什么不同?
我在一个应用程序中使用了ReactJs,并且我需要添加针对所有字段的验证。 我想添加针对姓名,电话号码,电子邮件,密码和确认密码的验证。 当任何人在这些字段中输入一些无效数据时,验证消息应该与字段一起显示。 import React from 'react';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import FormControlLabel from '@materi
我正在尝试按照文档上的代码设置一个material ui日期范围选择器示例,但它给了我一个错误: TypeError: undefined is not a function。
我以前从来没有见过useState后面跟着一个组件,这就是抛出错误的原因。
React.useState<DateRange>([null, null])
完整代码:
import * as React from "react";
import { TextField } from "@material-ui/core";
import { DateRangePicker,
我不明白为什么此导入或任何其他导入不起作用:
import * as React from 'react';
import TextField from '@material-ui/core/TextField';
import * as PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
//import { PropTypes } from '@material-u
我试图在我的react应用程序中加入一个功能,用户将输入一个搜索词,当按下按钮时,它会搜索它。(文本输入和按钮正在使用material组件)现在,我只想让它将这个词打印到控制台日志中,以检查其是否正常。当运行下面的代码时,输出是:"object对象。有人知道为什么吗?“
import React from 'react';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
class
当我尝试准确地从文档中导入自动完成时:,我得到以下错误消息:
Failed to compile.
./node_modules/@material-ui/lab/esm/useAutocomplete/useAutocomplete.js
Attempted import error: 'unstable_useId' is not exported from '@material-ui/core/utils' (imported as 'useId').
react代码:
/* eslint-disable no-use-before-de
我不明白如何在reactjs material UI表单中实现验证。我非常了解正则表达式,但不知道如何在表单中实现验证,以便如果值无效,它应该通过错误消息:
这是我的组件;
import React from 'react';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import { FormGroup } from '@material-ui/co
我尝试下载了Material UI的一个示例,并尝试了文本字段。示例中的其他组件工作正常(例如,Dialogue、Button)。在TextField上,defaultValue是我尝试过的唯一有效的工具。谢谢你的帮助。
我一直收到错误:警告:未知属性hintText,floatingLabelText,floatingLabelFixed on tag。
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import TextField from '
我正在尝试使用MaterialUI的Autocomplete组件来实现React。编辑器中的所有东西看起来都很棒,而且编译起来也很好。然而,我得到了以下运行时错误:
app.js:42207 Uncaught TypeError: (0 , _utils.createSvgIcon) is not a function
at Object.393.@babel/runtime/helpers/interopRequireWildcard (app.js:42207)
at o (app.js:6)
at app.js:6
at Object.<anonym
所以我尝试在Material UI中在我的卡上显示一个图像,但是图像从来没有出现过,我非常确定图像的目录是正确的。此外,如果可能的话,有人可以帮助我模块化我的代码,因为你可以看到我的一些代码正在重复(例如,负责设置边距的框),我尝试使用HOC,但我一直收到这个错误Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export you