【发布时间】:2020-06-15 03:47:40
【问题描述】:
我收到此错误
我使用 npx-create-react-app 创建了一个新项目,然后按照此处写下的说明进行操作:https://react-bootstrap.github.io/getting-started/introduction
我已经安装了:npm install react-bootstrap bootstrap。
然后把CDN复制到我的index.html
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link
**rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>**
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
然后已经导入:
import React from 'react';
import {Grid} from 'react-bootstrap';
import './App.css';
function App() {
return (
<div className="container">
<Grid className ="purchase-card">
<h1>Hello World</h1>
</Grid>
</div>
);
}
export default App;
我尝试在 Google 上搜索解决方案和导入变体(例如,从“react-bootstrap/Button”导入按钮),但我似乎找不到导致此问题的问题。
【问题讨论】:
-
Grid甚至是react-bootstrap组件吗?我在文档中没有看到对它的任何引用? -
这可能是你的问题:grid was renamed to container