我正在使用 react-google-maps 包https://github.com/tomchentw/react-google-maps和https://www.npmjs.com/package/react-google-maps。我遇到一个错误,显示:./src/App.js Line 31: 'google' is not defined no-undef Line 32: '
2017-08-18
我正在创建一个使用 react-google-maps 的网站,但出现了一堆未定义的错误。我是 react/js 世界的新手,所以任何帮助都会非常感激。以下是确切的错误:Failed to compile../src/App.jsLine 23: 'lifecycle' is not defined no-undefLine 25: 'google' is not defined n
2018-05-27
componentDidMount() {window.initMap = this.initMap((doc, script) => {const element = doc.getElementsByTagName(script)[0];const fjs =element;let js = doc.createElement(script);js.src = `https://maps.
2018-11-21
我正在使用react-google-maps/api节点模块。我需要将zoomControlOptions的值设置为TOP_LEFT,但最终收到此错误Uncaught ReferenceError: google is not defined。这是存储库的链接。我在这里收到错误const options = {zoomControl: true,mapTypeControl: false,minZ
2021-10-22
我正尝试根据此示例构建基于 Redux 的通知器:https://material-ui.com/components/snackbars/#CustomizedSnackbars.tsx以下是我想到的内容:import { Snackbar } from '@material-ui/core';import MuiAlert, { AlertProps } from '@material-ui/
2020-01-20
我正在使用 React 制作一个简单的网页,并使用来自material-ui 的 createMuiTheme 在主题中定义了以下调色板。palette: {primary: {main: "#333333"},secondary: {main: "#727171"},background: {paper: "#f8f3f0",default: "#f8f3f0"},accent: {main:
2020-04-02
我们已使用自定义组件 (MySnackbarContent) 扩展了 SnackbarContent 组件:export interface MySnackbarContentProps extends Omit<SnackbarContentProps, 'variant'> {variant?: MyCustomVariant;type?: MyCustomType;banner?: bool
2020-04-30
makeStyles 不再从 @mui/material/styles 导出。即使我在我的项目中从@mui/styles导入,但仍然显示此错误。我删除了node_modules并重新安装,但没有工作
2021-09-28
我正在学习 Material UI,在课程中,讲师要求我只设计一个组件的样式,而不是整个主题。为此,它使用makeStyles函数并传播theme.mixins.toolbar。问题是,当我这样做时,我遇到了以下错误:TypeError: Cannot read properties of undefined (reading 'toolbar')本课程显然是版本 4,而我使用的是版本 5。尽管如
2021-10-12
我正在为自己构建一个小型、简单的 Wiki;刚开始学习 React,尽管我之前一直在使用 JavaScript。我似乎无法设置主题。我正在尝试将背景设置为黑色。我正在这样做: const darkMode = true;const theme = createTheme({palette: {type: darkMode ? 'dark' : 'light',background: {defau
2021-12-24
我尝试使用我的 React 18.0 项目安装 Material UI 和图标,但无法安装。该项目已使用最新的 create-react-app 创建npm install @material-ui/core @material-ui/iconsnpm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency treenpm
2022-04-01
我不明白我做错了什么。我正在尝试将子组件添加到主页。我推断它与最后应用的 MUI 样式有关。我删除了所有不相关的代码,但仍然面临此错误。这不是实现 withStyles 的正确方法吗?我正在尝试将表放在单独的组件中并在那里处理所有数据管理。然后该组件将在主页上呈现。我使用的是 React 16.13.1、material-ui 4.12.4、@types/react 16.9.56、typescr
2022-04-13
我有一个使用 MUI 制作的小应用程序。它运行良好,直到我尝试添加ThemeProvider。一旦完成,应用程序就会中断,并且我正在使用的所有 MUI 组件都会开始抛出undefined。我正在尝试使用createTheme,并确保从"@mui/material/styles"导入它,因为我知道有一个类似的包会给其他人带来问题。这是我的代码:const light = {palette: {typ
2022-04-19
我刚刚安装了 Material UI,发现如下消息:Compiled with problems:ERROR in ./node_modules/@mui/material/AccordionActions/AccordionActions.js 7:0-70Module not found: Error: Can't resolve '@mui/base' in 'C:\..\node_modu
2022-06-05
我发现下面的代码是有意义的,它只是在用户上传文件时显示文件名,但我收到无法读取文件名未定义属性的错误?为什么?我不是已经将文件名设置为空了吗?export default class fileUpload extends Component {constructor(props) {super(props);React.defaultProps = {filename: null}}handleO
2017-04-09