[英]After Creating my React Project.When I made Components and Context folder in src I am getting this error.What should I do?
CreateContext.text cannot be compiled under '--isolated modules because it is considered a global script file.
CreateContext.text 不能在 '--isolated 模块下编译,因为它被视为全局脚本文件。 Add an import, export, or an empty 'export {}' statement to make it a module.
添加导入、导出或空的“导出{}”语句以使其成为模块。
The file CreateContext.text
is considered a global script file, which means it is not a module.文件
CreateContext.text
被认为是一个全局脚本文件,这意味着它不是一个模块。 Are you exporting or importing something in this file?您是否在此文件中导出或导入某些内容? Otherwise, it will keep considering this file as a script and not a module.
否则,它将继续将此文件视为脚本而不是模块。
You can check the documentation for isolated modules here.您可以在此处查看隔离模块的文档。
On a side note, you probably shouldn't use .text
extension for the context file.附带说明一下,您可能不应该为上下文文件使用
.text
扩展名。 You can keep using .js
or .jsx
.您可以继续使用
.js
或.jsx
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.