angularjs - 如果有简单的方法,为什么我们需要reactjs-bootstrap?

标签 angularjs twitter-bootstrap reactjs react-bootstrap angular-bootstrap

我一直在使用 React 或 Angular 开发 Web 应用程序,但我很困惑为什么人们会使用像 React-bootstrap ( https://react-bootstrap.github.io/introduction.html ) 或 Angular-bootstrap 这样的库?因为当我创建时,我只需使用链接标签及其相应的 js 库加载 css 框架,然后在reactjs 端,我只需放置组件所需的类。听起来不是更容易吗?

谢谢

最佳答案

它与 Bootstrap 的 Javascript 部分有关。 CSS 与链接标签一起工作得很好。

但是 React 和 Angular 都是 Javascript 库,它们有很多用于操作 DOM 的底层功能。如果您还使用 Bootstrap 或 jQuery 之类的东西来操作 DOM,它可能无法与 React 或 Angular 很好地配合,因为它们可能同时尝试以非常不同的方式做类似的事情。因此,与 DOM 相关的 Javascript 库需要重写,以便它们能够与 React/Angular 很好地配合。

来自react-bootstrap文档:

we don't ship with any included css

他们只处理 JS。

关于angularjs - 如果有简单的方法,为什么我们需要reactjs-bootstrap?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46249605/

相关文章:

angularjs - 我可以获得 Angular 元素的编译后的 html 吗?

javascript - Angular $http 参数编码问题

html - 完美的中心与 Bootstrap 水平对齐

html - 在 Bootstrap 3 中向导航栏添加按钮的正确方法

reactjs - HandlingChange 输入 REACTJS + TypeScript 错误

reactjs - React ant 设计表单中的电子邮件验证

angularjs - Angular 嵌套指令未在模型中显示新实体

javascript - 带 iframe 的 AngularJs

html - 使用 bootstrap/css 时在图像旁边填充

Javascript,在 React 应用程序中分配给函数组件中的 {},代码审查