reactjs - 这个反应网络应用程序页脚中的错误在哪里?
问题描述
当我尝试在本地编译我的应用程序时,它不会运行。这一定是一个非常简单的错误,但我似乎无法找到它。我也不是经验丰富的程序员,所以答案似乎很明显。感谢您的任何帮助!
这是代码:
import React from 'react';
import { Link } from 'react-router-dom';
import twitterIcon from './twitterIcon.svg';
import facebookIcon from './facebookIcon.svg';
import './Footer.css';
const Footer = () => (
<div className="Footer-wrapper">
<div className="Footer-text-links-wrapper">
<Link to="/about">
<span className="Footer-text-link">About</span>
</Link>
<Link to="/faq">
<span className="Footer-text-link">FAQ</span>
</Link>
<Link to="/contact">
<span className="Footer-text-link">Contact</span>
</Link>
<a href="xxx"><span className="Footer-text-link">Community</span></a>
</div>
// <div className="Footer-icon-links-wrapper">
// <a
// href="https://www.twitter.com"
// target="_blank"
// rel="noopener noreferrer"
// >
// <img src={twitterIcon} className="Footer-icon-link" alt="twitter" />
// </a>
// <a
// href="https://www.twitter.com"
// target="_blank"
// rel="noopener noreferrer"
// >
// <img src={facebookIcon} className="Footer-icon-link" alt="facebook" />
// </a>
//
// </div>
</div>
);
export default Footer;
这是每个终端的错误:
Failed to compile.
./src/components/Footer/Footer.js
Syntax error: Unexpected token (40:2)
38 | //
39 | // </div>
> 40 | </div>
| ^
41 | );
42 |
43 | export default Footer;
解决方案
注释不能像//
JSX 中的 Javascript 那样。要编写评论,您可以执行类似 `{/* ...comment */} 的操作。所以在你的代码中它看起来像
</div>
{/* <div className="Footer-icon-links-wrapper">
...
</div> */}
</div>
推荐阅读
- ruby-on-rails - Rails 6.1 form_with 不发送 PUT 请求
- flutter - flutter_wordpress - StreamBuilder 花费了太多时间来显示数据
- python - Python 文本命令不会在实际文本文件中输出字符串数据
- c# - 未调用具有等待模式的 C# 套接字 ReceiveAsync
- jquery - JQUERY - FACEBOX - 访问创建的对象和方法
- next.js - Next.js 中的别名区域设置
- tensorboard - Tensorboard 图形页面仅显示在一个小区域
- reactjs - 如何从用户的以太坊地址进行 Tx?
- java - 有没有办法在 Struts 2 中使用带有键和值的 ActionError 来用异常消息替换属性文件中的替换参数?
- python - Django - 从 models.py 和迁移中删除表后,我得到“关系”不存在”
所以我意识到我可以删除一个表并将其作为多对多关系添加到另一个模型,然后我从文件夹中的迁移文件中删除了表的创建。但由于某种原因,当我打电话时,我收到以下错误
python manage.py migrate
django.db.utils.ProgrammingError: relation "<table name>" do