我正在尝试为网页添加页脚。它看起来是这样的:
import React from 'react';
import { Row, Col, List, ListInlineItem } from 'reactstrap'
import { HashLink } from 'react-router-hash-link';
import { Link } from 'react-router-dom';
import logo from './../assets/logo.png'
export function Footer(props) {
return (
<div>
<hr />
<Row>
<Col xl="2" lg="2" className="d-none d-lg-block">
<img src={logo} className="img-side" alt="Loading..." />
</Col>
<Col xl="8" lg="8" md="12" sm="12" xs="12">
<center>
<small>
<p><a href="">Privacy Policy</a></p>
<List type="inline">
<ListInlineItem>
<Link to="/">Home</Link>
</ListInlineItem>
<ListInlineItem>
<HashLink to="/#product">Product</HashLink>
</ListInlineItem>
<ListInlineItem>
<Link to="/overview">Solution</Link>
</ListInlineItem>
<ListInlineItem>
<HashLink to="/#getintouch">Contact Us</HashLink>
</ListInlineItem>
</List>
<p><a href="">Subscribe to Newsletter</a></p>
</small>
</center>
</Col>
</Row>
</div>
);
}当我试图竖起这个页面时,我得到了以下错误:
Attempted import error: 'List' is not exported from 'reactstrap'.我不确定是什么导致了这个问题,因为Reactstrap网站here上有List的文档。我也曾考虑过this question的解决方案,但由于我使用的是带括号的导入,这对我并没有真正的帮助。我也试着遵循here指南,但也没有帮助。作为参考,我根据npm list reactstrap命令使用reactstrap 8.4.1。我在这里做错了什么?
发布于 2021-03-20 12:36:39
在我的例子中,这是可行的。
npm install --save reactstrap
npm audit fix --forcehttps://stackoverflow.com/questions/66718139
复制相似问题