Advantages of using react-bootstrap over bootstrap

前端 未结 4 1052
半阙折子戏
半阙折子戏 2021-01-31 15:06

What\'s the point in using react-bootstrap over plain old Bootstrap?

I was going through https://react-bootstrap.github.io/components.html and I don\'t see any advantag

4条回答
  •  名媛妹妹
    2021-01-31 15:44

    React-bootstrap creates React components for you.

    The advantage will be obvious if you consider how to do animations with the help of bootstrap in your React project.

    Without react-bootstrap, you need something like CSSTransitionGroup. You cannot take advantage of bootstrap's API because it will manipulate the DOM, which makes the React behavior unpredictable. Also, bootstrap will hide details of their animation API; that is to say,you cannot use it at all.

    With bootstrap components, however, you do not need to worry about how the animation is implemented by bootstrap, you just need to specify properties and hooks in a component and the library will do the trick. More specifically, it can add some wrappers which are not visible to the client.

    As you can see above, and component is added by bootstrap.

    In addition, the syntax of virtual DOM may not be compatible with DOM:

    As shown above, putting inside a

    提交评论

提交回复
热议问题