reactjs - 尝试导入错误:“reactstrap”不包含默认导出(导入为“表”)
问题描述
我什至尝试import {Table} from 'reactstrap';
使用花括号。当与花括号一起使用时,数据将出现但不作为表格。我的 reactstrap 也是最新版本。这是显示的错误:尝试导入错误:“reactstrap”不包含默认导出(导入为“表”)。
这是我的 Assignment.js。
import Table from 'reactstrap';
class Assignment extends Component{
render(){
return(
<Table dark>
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</Table>
)
}
}
导出默认作业;`
解决方案
https://reactstrap.github.io/?path=/docs/home-upgrading--page
移除的组件
InputGroupAddon - This in no longer needed in Bootstrap 5, you can now add Buttons, Inputs directly to InputGroups in the order you wish.
InputGroupButtonDropdown - This can now be replaced with a regular Dropdown component.
CustomInput - These are no longer needed in Bootstrap 5, since all form inputs will be styled by Bootstrap instead of browser default. The existing Input component now supports file, select, switch, and range types.
Jumbotron - Jumbotrons have been removed from Bootstrap 5, can be replaced with <div class="rounded px-3 px-sm-4 py-3 py-sm-5">. Jumbotron fluid can be replaced with <div class="bg-light mb-4 py-3 py-sm-5">
推荐阅读
- ruby-on-rails - Rails Searchkick 与控制器中的范围
- django - 如何在预取的模型上选择相关?
- apache - RewriteEngine 和排除目录
- regex - 正则表达式转义 Groovy 中的特殊字符
- html - Rails 图片问题
- javascript - 在 React Native 渲染文本组件中显示动画值
- mysql - SAMP Pawno mysql r41-4 无效连接句柄 '1'
- javascript - 在所选复选框的行中选择特定值并检查重复项
- python - Python Flask 应用程序使用 ajax 将远程服务器文本文件输出到网络服务器并显示在网页上,找不到 404
- react-native - 解析服务器应用程序,只有一个管理员用户可以通过 Facebook 登录更改数据