vscode中使用reactjs报告错误 [英] Used the reactjs in vscode was report an error
本文介绍了vscode中使用reactjs报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用"jsx"Visual Studio代码中的语法.Visual Studio代码报告错误
use "jsx" grammar in visual studio code. visual studio code report an error
请帮助我.谢谢!!!
Please help me. Thanks!!!
推荐答案
符号<"应该与标签名称显示在同一行.
The symbol "<" should appear in the same line with the tag name.
例如,而不是这样做:
return ( <
button className="square"> {/*TODO*/} <
/button>
)
这样做:
return(
<button className="square">
{/*TODO*/}
</button>
)
如果您想将标签分成多行,您可以这样做:
If you want to split the tag to multiple lines, you can do it like that:
return (
<button
className="square"
id="id"
onClick={someFunc}
>
{/*TODO*/}
</button>
)
这篇关于vscode中使用reactjs报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文