create-react-app搭建的项目中添加bootstrap
2017-12-06 16:25
846 查看
react-bootstrap是一个非常受欢迎的针对react封装过的bootstrap,它本身不包含css,所以也是需要使用bootstrap原生库。
在create-react-app建的项目目录中安装react-bootstrap。
安装bootstrap。
在index.js文件中增加css引用。
在需要用到bootstrap组件的代码中,引入所需组件。
react-bootstrap参考:
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-bootstrap https://react-bootstrap.github.io/getting-started.html
End
在create-react-app建的项目目录中安装react-bootstrap。
npm install react-bootstrap --save
安装bootstrap。
npm install bootstrap@3.3.7 --save
在index.js文件中增加css引用。
import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap-theme.css';
在需要用到bootstrap组件的代码中,引入所需组件。
import { Navbar, Jumbotron, Button } from 'react-bootstrap';
react-bootstrap参考:
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-bootstrap https://react-bootstrap.github.io/getting-started.html
End
相关文章推荐
- create-react-app项目添加less配置
- create-react-app项目添加less配置
- 用create-react-app搭建react项目
- Create-React-App项目外使用它的eslint配置
- create-react-app创建项目报错SyntaxError: Unexpected end of JSON input while parsing near '...ttachment":false,"tar' npm代理
- 使用create-react-app或者antd创建一个React项目
- 在基于 create-react-app 的React项目中进行代码分片、按需加载(code splitting)/ 免webpack配置
- 最新-使用create-react-app 生成项目怎么处理scss预处理器
- 升级Create React App的项目
- 在create-react-app创建的React项目应用中配置JQ、Sass
- react以create-react-app为基础创建项目
- create-react-app创建react项目,使用axios跨域
- create-react-app 创建项目失败
- create-react-app如何创建react项目?
- 使用create-react-app自动构建react项目
- Create-React-App创建React项目
- 以create-react-app为基础创建项目
- 以create-react-app为基础创建项目
- react---学习笔记:使用create-react-app快速构建开发环境并创建项目