我在某个地方读到,导入模块时会使用大括号来代替导入整个库,从而有效地增加了包的大小。我使用了这个概念,并且成功地导入了没有大括号的模块,比如:import Jumbotron from 'reactstrap';,它运行得很好。/React Coursera/Header.js 5:71-77 export default (imported as Jumbotron) was not found in reactstrap。此外,该应用程序没有在浏览器中运行。
Reactstrap可作为Reactstrap全局变量在页面上使用。我认为在环境模块中添加它就像添加react和react dom一样简单 这是我的global.d.ts import * as react from "react"
import * as react_dom但是我不能使用Reactstrap.Alert,tsc说Reactstrap.Alert是一个类型,但它被当做一个值来使用。我可以在d.ts文件中手动添加这个字符串export