0
我通过导入react-bootstrap组件来使用react-bootstrap,但由于某种原因,类样式不适用于元素,即使我可以看到引导类被赋予相应的DOM中的元素。我使用自己的班级进行定位,它不会覆盖任何内容。有没有人有任何想法可能是错的?例如:这里https://react-bootstrap.github.io/getting-started.html描述React-bootstrap类样式不适用
import React, { Component } from 'react'
import {Alert} from 'react-bootstrap'
class Error extends Component {
render() {
const {errorText} = this.props
return (
<Alert bsStyle="warning" className="error-container">
<div className="error-msg">{errorText}</div>
</Alert>
);
}
}
有没有你的地方添加引导样式表,可能在'index' HTML文件。 – Panther
不,我搞砸了。我认为只需导入组件就足够了。 – Umbrella