Skip to content

Commit 463adee

Browse files
committed
Merge pull request react-bootstrap#1382 from taion/document-import
Explain why to import components from lib/
2 parents e4ccf66 + 2d0177c commit 463adee

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

docs/src/GettingStartedPage.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class Page extends React.Component {
2121
<div className="col-md-9" role="main">
2222
<div className="bs-docs-section">
2323
<h2 className="page-header"><Anchor id="setup">Setup</Anchor></h2>
24-
<p className="lead">You can import the lib as AMD modules, CommonJS modules, or as a global JS script.</p>
24+
<p className="lead">You can import the library as CommonJS modules, as ES6 modules via Babel, as AMD modules, or as a global JS script.</p>
2525

2626
<p>First add the Bootstrap CSS to your project; check <a href="http://getbootstrap.com/getting-started/" name="Bootstrap Docs">here</a> if you have not already done that. Note that:</p>
2727
<ul>
@@ -31,11 +31,12 @@ export default class Page extends React.Component {
3131
<p>Then:</p>
3232

3333
<h3><Anchor id="commonjs">CommonJS</Anchor></h3>
34+
<p>If you install React-Bootstrap using NPM, you can import individual components under <code>react-bootstrap/lib</code> rather than the entire library. Doing so pulls in only the specific components that you use, which will reduce the size of your client bundle.</p>
35+
3436
<div className="highlight">
3537
<CodeExample
3638
codeText={
37-
`$ npm install react
38-
$ npm install react-bootstrap`
39+
`$ npm install react react-bootstrap`
3940
}
4041
/>
4142
<br />
@@ -53,8 +54,7 @@ var Alert = require('react-bootstrap').Alert;`
5354
<div className="highlight">
5455
<CodeExample
5556
codeText={
56-
`$ npm install react
57-
$ npm install react-bootstrap`
57+
`$ npm install react react-bootstrap`
5858
}
5959
/>
6060
<br />
@@ -72,8 +72,7 @@ import { Button } from 'react-bootstrap';`
7272
<div className="highlight">
7373
<CodeExample
7474
codeText={
75-
`$ bower install react
76-
$ bower install react-bootstrap`
75+
`$ bower install react react-bootstrap`
7776
}
7877
/>
7978
<br />
@@ -85,8 +84,8 @@ $ bower install react-bootstrap`
8584
/>
8685
</div>
8786

88-
<h3 className="page-header"><Anchor id="browser-globals">Browser globals</Anchor></h3>
89-
<p>The bower repo contains <code>react-bootstrap.js</code> and <code>react-bootstrap.min.js</code> with all components exported in the <code>window.ReactBootstrap</code> object.</p>
87+
<h3><Anchor id="browser-globals">Browser globals</Anchor></h3>
88+
<p>The Bower repo contains <code>react-bootstrap.js</code> and <code>react-bootstrap.min.js</code> with all components exported in the <code>window.ReactBootstrap</code> object.</p>
9089
<div className="highlight">
9190
<CodeExample
9291
mode="htmlmixed"

0 commit comments

Comments
 (0)