当我输入我的React 路由器-dom时,我将我的路由指向一个验证页面。在目标是否被锁定的情况下,我将我的route(history)推到必需的页面,但是我一直在说错误。
Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, compare, WrappedComponent, displayName}). If you meant to render a collection of children, use an array instead.
in Unknow
我正在学习一个关于React的初学者课程。导航器。Bar有两个选项- About、HomePage。单击工具栏时,url会更新,但页面保持不变,nav保持不变。我没有得到任何错误。 App.js import React from 'react';
import HomePage from './HomePage';
import About from './About';
import Header from './common/Header';
function App() {
function getPage()
我有页面(MyNotes.js),它显示了所有针对该用户的注释。因此,当按下按钮查看详细信息时,用户将被重定向到另一个页面(NoteDetail.js),在该页面中,我将传递特定于该特定注释的id。在重定向页面中,在id的帮助下,我调用一个api并填充数据。但是现在,如果用户将后退按钮按到上一页(MyNotes.js),我将得到以下错误
MyNotes.js:30 Uncaught TypeError: notes.map is not a function
at MyNotes (MyNotes.js:30:1)
at renderWithHooks (react-dom.d
我正在尝试学习React Js,但我不能解决我得到的错误:我的一个组件在本地服务器Localhost:3000上工作良好,但相同的代码在生产服务器localhost:5000或Internet上我的域上显示了一个错误。 TypeError: this.state.students.map is not a function
at a.value (View.js:23)
at a.value (View.js:42)
at Vi (react-dom.production.min.js:187)
at Bi (react-dom.production.min.
为什么这段代码会创建“无效钩子调用”?
react和react-dom是同一版本的16.8.6版本。
简单地调用useState触发器错误?
我遗漏了什么?
$ npm ls react react-dom
vehmain@0.1.0 /mnt/g/development/javascript/pow-vehmain
├── react@16.8.6
└── react-dom@16.8.6
运行时:
Invalid hook call. Hooks can only be called inside of the body of a function component...
Service
我有一个组件,它在其呈现方法中生成一个错误。
在树的上层,组件被connect()编辑成一个资源,使用react-redux来获取数据,我还有其他HOCS等等(注入类等等)。
组件使用错误边界,以防(例如)提供给它的资源中缺少属性(常见问题)。
我提取了最小的示例,访问未定义的属性来复制相同的错误:
import React from 'react'
// An Error Boundary which returns either a fallback component (if supplied to props) or (default) an empty div, i
在导入Imex之前,该应用程序运行良好,没有任何错误,它显示了4个错误,如下所示
1. Warning: React.jsx: 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 your component from the file it's defined in, or you might have mixed up