首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用React-Starter-kit安装Reactstrap

如何使用React-Starter-kit安装Reactstrap
EN

Stack Overflow用户
提问于 2018-01-14 14:32:02
回答 4查看 3.4K关注 0票数 0

react-starter-kit https://github.com/kriasoft/react-starter-kit

reactstrap http://reactstrap.github.io/

将reactstrap安装到react-starter-kit中的步骤是什么?为了使用网格布局?

http://reactstrap.github.io/components/layout/

EN

回答 4

Stack Overflow用户

发布于 2018-01-25 14:44:43

步骤:

  1. 在终端下载repo
  2. 类型:

代码语言:javascript
运行
复制
yarn add reactstrap
yarn add react-transition-group
yarn add bootstrap

  1. 在组件文件中,键入以下代码:

代码语言:javascript
运行
复制
import 'bootstrap/dist/css/bootstrap.css';
import { Container, Row, Col } from 'reactstrap';

  1. ,然后你可以在你的渲染函数中测试reactstrap的布局特性,如下所示:

代码语言:javascript
运行
复制
<Container>
  <Row>
    <Col>.col</Col>
  </Row>
  <Row>
    <Col>.col</Col>
    <Col>.col</Col>
    <Col>.col</Col>
    <Col>.col</Col>
  </Row>
  <Row>
    <Col xs="3">.col-3</Col>
    <Col xs="auto">.col-auto - variable width content</Col>
    <Col xs="3">.col-3</Col>
  </Row>
</Container>
票数 1
EN

Stack Overflow用户

发布于 2018-01-22 22:46:04

使用create-react-app怎么样?这就是我正在使用的.

代码语言:javascript
运行
复制
npm install -g create-react-app
create-react-app my-app

然后,按照reactstrap的README上的说明安装bootstrap、reactstrap、react和react-dom:

代码语言:javascript
运行
复制
npm install --save reactstrap@next react-addons-transition-group
react-addons-css-transition-group bootstrap@4.0.0-beta.2
react-dom@^16.0.0

希望这能帮到你。

票数 0
EN

Stack Overflow用户

发布于 2021-05-29 02:04:23

假设您使用的是npm而不是yarn

代码语言:javascript
运行
复制
npm i --save reactstrap # (http://reactstrap.github.io/)
npm i --save react-bootstrap bootstrap # (https://react-bootstrap.github.io/)
npm install --save reactstrap react react-dom # (http://reactstrap.github.io/);

但我认为最后一个就是你要找的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48247229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档