原因是这样的:

我把一个组件分为三个文件,

               |—Home.jsx         //  业务逻辑与html
Home——|—Home.css // 样式
|—index.js // 引入Home.css ,再把Home组件暴露出去

其中index.js是对Home.js 的导出,和对Home.css的导入,代码是这样的:

export { default } from "./Home.jsx";
import "./Home.css";

于是,,,,于是,就报错啦, 以前这样写也没问题的呀,google搜搜说是因为这个:

import 必须在其它所有业务代码前面(eslint 暴出),

异步组件导入了 也不能插在其他导入的东西前面,

类似的行为都会报这个错误

改成这样就好啦:

import "./Home.css";
export { default } from "./Home.jsx";

好吧,我这儿其实就是调换个位置~

react编译报错:Import in body of module; reorder to top import/first的更多相关文章

  1. maven项目编译报错:Type Dynamic Web Module 3.0 requires Java 1.6 or newer.

    在maven的pom.xml文件中增加: <build>   <plugins>     <plugin>         <groupId>org.a ...

  2. react+typescript报错集锦<持续更新>

    typescript报错集锦 错误:Import sources within a group must be alphabetized.tslint(ordered-imports) 原因:impo ...

  3. iOS二维码生成-libqrencode编译报错

    libqrencode使用 1.将libqrencode文件夹整个拖入项目文件夹中 2.在要生成二维码的页面的 .m文件头部添加 #import "QRCodeGenerator.h&quo ...

  4. webStrom中React语法提示,React语法报错处理

    1,webStrom中React语法报错 ①, 取消Power Save Mode的勾选 File——Power Save Mode ②,webstorm开发react-native智能提示 随便在一 ...

  5. Spark程序编译报错error: object apache is not a member of package org

    Spark程序编译报错: [INFO] Compiling 2 source files to E:\Develop\IDEAWorkspace\spark\target\classes at 156 ...

  6. 使用C#模拟Outlook发送邮件,代码编译报错

    添加OutLook API using OutLook = Microsoft.Office.Interop.Outlook; 发送邮件方法 public void SendEmail() { Out ...

  7. cordova编译报错:Execution failed for task ':processDebugResources'

    cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...

  8. 编译报错dereferencing pointer to incomplete type

    关于编译报错“dereferencing pointer to incomplete type... 多是没找到结构体的定义,可以在本地复制其定义试试. 参考: http://my.oschina.n ...

  9. Maven-010-maven 编译报错:Failure to ... in ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced.

    今晚在编译 maven 项目的时候,命令行报错,出现 Failure to ... in ... 类似错误,详细的错误信息如下所示: [INFO] -------------------------- ...

随机推荐

  1. Windows下使用Diskpart格式化U盘

    步骤 进入Diskpartdiskpart 列出所有的磁盘list disk 选择磁盘select disk 清楚clean 创建主分区creat partition parimary 激活当前分区a ...

  2. bzoj1218 激光炸弹

    bz上难得一见的水题啊. 我们发现:这个SB居然只要枚举就行了!!! 我TM...... /****************************************************** ...

  3. Git使用全解

    起步 关于版本控制 Git 简史 Git 基础 安装 Git 初次运行 Git 前的配置 获取帮助 小结 Git 基础 取得项目的 Git 仓库 记录每次更新到仓库 查看提交历史 撤消操作 远程仓库的 ...

  4. C# winform TreeView中关于checkbox选择的完美类[转]

    http://www.cnblogs.com/kingangWang/archive/2011/08/15/2139119.html public static class TreeViewCheck ...

  5. jquery的checked以及disabled

    下面只提到checked,其实disabled在jquery里的用法和checked是一模一样的 下边两种写法没有任何区别 只是少了些代码而已... ------------------------- ...

  6. springcloud使用zookeeper作为config的配置中心

    https://blog.csdn.net/CSDN_Stephen/article/details/78856323 仓库更新了,本地如何更新: 使用configserver作为配置中心: http ...

  7. (逆序对 分治法)P1908 逆序对 洛谷

    题目描述 猫猫TOM和小老鼠JERRY最近又较量上了,但是毕竟都是成年人,他们已经不喜欢再玩那种你追我赶的游戏,现在他们喜欢玩统计.最近,TOM老猫查阅到一个人类称之为“逆序对”的东西,这东西是这样定 ...

  8. 流畅的python--python数据模型

    python最好的品质之一就是一致性.初步接触python可能会len(collection)而不是collection.len()觉得不适应,这是通常所说的“python风格”(Pythonic)的 ...

  9. fiddler模拟返回

    先把正常的请求响应报文保存为文件,操作方法为选中对应请求>右键> save >reponse>entire response 点击改请求,点击右侧autoresponder,点 ...

  10. 根文件系统之init

    title: 根文件系统之init tag: arm date: 2018-11-12 18:53:23 --- 引入 在Kernel源码分析中,了解到init_post是在挂载根文件系统之后执行应用 ...