React JSX错误:未封闭的正则表达式 [英] React JSX error : Unclosed regular expression
本文介绍了React JSX错误:未封闭的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最近,我在Visual Studio代码上编码React应用程序时遇到问题.由于这个问题,每当我在React Component的render函数中编写JSX并将其保存时,它都会变得混乱(我的意思是缩进会变得混乱).看图片:
Recently I was facing an issue coding React app on Visual Studio code. Because of this issue, whenever I wrote JSX inside the render function of the React Component and saved it, it would go messed up (I mean indentation would get messy). See the pic:
此错误也显示如下错误: 1.未封闭的正则表达式
This error was also showing error like: 1. Unclosed regular expression
如何解决这个问题?
推荐答案
如果使用的是jshint
插件,请将其删除并安装ESLint
插件.
If you are using jshint
plugin, remove it and install ESLint
plugin.
它是ReactJS工作中jshint
的很好替代.
It is a good replacement for jshint
in reactJS work.
这篇关于React JSX错误:未封闭的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文