[英]Bootstrap and react-bootstrap
我正在学习 react.js,我需要让我的应用程序响应。 我应该使用什么? 引导程序或反应引导程序? 我可以在反应中使用 Bootstrap 吗? 或者我需要使用 react-bootstrap? 有什么不同
react-bootstrap是一个类似于material-ui或许多其他 UI 库的 UI 组件库,而 Bootstrap 本身就是 CSS 类 + HTML UI 组件的集合。
您可以自由选择它们,react-bootstrap 或 Bootstrap 由您选择。
你可以在这里阅读更多关于它们的信息
引导程序:
import * as React from 'react';
function Example() {
return (
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>Oh snap! You got an error!</strong>
<p>
Change this and that and try again.
</p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
)
}
反应引导:
import * as React from 'react';
import Alert from 'react-bootstrap/Alert';
function Example() {
return (
<Alert dismissible variant="danger">
<Alert.Heading>Oh snap! You got an error!</Alert.Heading>
<p>
Change this and that and try again.
</p>
</Alert>
)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.