【发布时间】:2021-04-18 12:09:30
【问题描述】:
我正在将 React 与 CDN 链接一起使用,并且在有点头疼之后意识到我需要了解为每个库配置的全局变量是什么才能使用它们。
例如在 React-Redux 中,而不是:
import {connect} from 'react-redux'
这会导致:
Uncaught TypeError: Failed to resolve module specifier "react-redux". Relative references must start with either "/", "./", or "../".
我需要做的:
export default <b>ReactRedux.</b>connect(mapStateToProps, mapDispatchToProps)(Component)
就像我需要对 React.Component 做的那样。
这是有道理的。
现在我正在搜索为Reactstrap 定义的全局变量。不幸的是,使用 CDN 链接的demo link 已损坏(我已经opened an issue)。
我在网上搜索并浏览了 Reactstrap 文档,但找不到任何东西。
我猜应该是Reactstrap.X,但这不起作用。
我假设这不是一个新的请求,但我还没有找到答案(或被问到),所以如果你能帮助我,我会很高兴。
【问题讨论】:
标签: javascript reactjs reactstrap