React项目报错:Element type is invalid: expected a string 

起因:React使用Antd组件库,因为某些原因实在用不下去了,代码不变直接改成Tdesign组件库,于是就开始了解决无穷无尽的报错。。。

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 your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `Index`.

可能的原因:

  1. 组件名错误,比如MenuItem写成了Menu.item
  2. 还是组件名错误,比如antd里的Sider,Tdegsin里是Aside

React项目报错:Element type is invalid: expected a string可能的原因的更多相关文章

  1. ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.

    今天在重构一个页面的时候,碰到了一个error,具体的error信息如下图中所示: 最后经过一番查找定位,终于找到了问题所在,原因就是在父组件引用子组件时多加了一个大括号. import {Chart ...

  2. 导入项目报错:Type Java compiler level does not match the version

    1,导入项目报错一般是因为缺少jar包或者是jar包冲突 2,导入的jar包版本问题 3,环境需要重新修改,比如build path 中重新add libararies 遇到这种compiler环境问 ...

  3. React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

    昨天在项目中,重新封装组件时,引用了原来的一个子组件,但发现子组件在其他页面正常,在新的组件里面就发生保存, 然后把子组件注释,随便显示其div元素也正常,纠结了很久,最后发现引用的方式有问题 子组件 ...

  4. 【React踩坑记三】React项目报错Can't perform a React state update on an unmounted component

    意思为:我们不能在组件销毁后设置state,防止出现内存泄漏的情况 分析出现问题的原因: 我这里在组件加载完成的钩子函数里调用了一个EventBus的异步方法,如果监听到异步方法,则会更新state中 ...

  5. 【React踩坑记三】React项目报错Can't perform a React state update on an unmounted component

    意思为:我们不能在组件销毁后设置state,防止出现内存泄漏的情况 分析出现问题的原因: 我这里在组件加载完成的钩子函数里调用了一个EventBus的异步方法,如果监听到异步方法,则会更新state中 ...

  6. React报错之Element type is invalid

    总览 产生"Element type is invalid -- expected a string (for built-in components) or a class/functio ...

  7. 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.

    运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...

  8. Vue报错之"[Vue warn]: Invalid prop: type check failed for prop "jingzinum". Expected Number with value NaN, got String with value "fuNum"."

    一.报错截图 [Vue warn]: Invalid prop: type check failed for prop "jingzinum". Expected Number w ...

  9. 使用react脚手架创建项目报错-You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1).

    创建项目报错: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1). We no ...

  10. MyEclipse中“擅自乱改”项目名导致项目报错的处理

    最近几天培训的过程中,经常有同学手一抖,默默的修改了本来配置部署好的项目名,导致项目报错…… 遇到这种事情,我一般会做的处理就是重新新建项目,然后把包和各种文件ctrl+c ctrl+v,遇到项目小还 ...

随机推荐

  1. java中匿名类,Bean规范,全局变量

    实现看见一个人,我们对它说hello public class study01 { public static void main(String[] args) { Me me = new Me(); ...

  2. Linux中ARP学习和老化机制

    本文分享自天翼云开发者社区<Linux中ARP学习和老化机制> 作者:云云生息 ARP学习和老化机制在Linux网络通信中起着至关重要的作用.ARP(Address Resolution ...

  3. RocketMQ实战—5.消息重复+乱序+延迟的处理

    大纲 1.根据RocketMQ原理分析为什么会重复发优惠券 2.引入幂等性机制来保证数据不会重复 3.如何用死信队列处理优惠券系统数据库宕机 4.基于RocketMQ的订单库同步为什么会消息乱序 5. ...

  4. 如何配置 maven 编译插件的 JDK 版本

    普通maven项目配置编译器版本 参考maven官方文档 Setting the -source and -target of the Java Compiler maven有2种方法设置编译JDK版 ...

  5. SMMS图床Java接口上传

    前言 个人项目开发中,网站建设中需要用到大量的图片以及用户上传的图片,如果服务器带宽小,磁盘容量小将所有的图片信息全部存储在服务器上不太现实,这里建议将图片数据存储在对象存OSS上或者将图片保存在图床 ...

  6. DeepSeek企业级部署实战指南:从服务器选型到Dify私有化落地

    对于个人开发者或尝鲜者而言,本地想要部署 DeepSeek 有很多种方案,但是一旦涉及到企业级部署,则步骤将会繁琐很多. 比如我们的第一步就需要先根据实际业务场景评估出我们到底需要部署什么规格的模型, ...

  7. MySQL2022.3.2

    创建库 CREATE DATABASE STUDENT; 创建表 CREATE TABLE STU(SNO INT PRIMARY KEY,//主键SNM CHAR(2) NOT NULL,//不能为 ...

  8. ABAQUS阻尼设置

    结构阻尼 瑞利阻尼

  9. RCE_STUDY

    概念 RCE(Remote code execution)远程代码执行漏洞,RCE又分命令执行和代码执行. RCE-远程代码执行:远程执行PHP代码 RCE-远程命令执行:远程执行Linux或者Win ...

  10. go 编译约束//go:build dev //+build

    前言 在真实环境中,我们可能需要为不同的编译环境编写不同的 Go 代码,所以需要做构建约束. 比如:syscall.NewLazyDLL("test.dll") 加载 dll 的程 ...