小编典典

Bootstrap与React JS崩溃

reactjs

嗨,我正在尝试在React视图中使用bootstrap崩溃,但是它没有用。这很简单,但是我不知道发生了什么。

return (<div>
    <button className="btn" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="true" aria-controls="collapseExample">
        ButtonClickthis!
    </button>
    <div className="collapse" id="collapseExample">
        <div className="well">
            ...blablablacontent
        </div>
    </div>
</div>);

阅读 259

收藏
2020-07-22

共1个答案

小编典典

对于响应组件,Bootstrap不能立即使用,因为它会在加载时解析DOM并附加事件侦听器等。您可以尝试诸如react-
bootstrap之类的方法,
也可以在componentDidMount生命周期内手动触发。

大卫

2020-07-22