首页 > 解决方案 > bsPrefix prop not working for React Bootstrap?

问题描述

I need to change the base class for the Popover component in React Bootstrap as styles have been set globally for popover which are conflicting with a new component Im trying to make.

The doc say the bsPrefix prop can do this but it's not working for me. When I pass it to my component the base class doesn't change it just gets rendered out to the DOM

In React:

    <Popover id="popover-basic" bsPrefix="find-me">
      {children}
    </Popover>

In the DOM:

<div id="popover-basic" bsprefix="find-me" role="tooltip" class="fade in popover bottom" style="display: block; top: 202px; left: 590px;">

标签: react-bootstrap

解决方案


Turns out I had an old version of the library. Updating 0.31.5 to 1.0.0-beta.8 (latest) and it works.


推荐阅读