Some basic thoughts on React-Bootstrap (and NPM/GULP/Bootstrap itself)

It’s important to separate Bootstrap the CSS from Bootstrap the script. (Even if you include the script, none of the styles are included by default.  In general, you have to include the styles in your HTML as usual.)

If you include react-bootstrap via require, you generally have to use the namespace resolution.

var ReactBootstrap = require("react-bootstrap");

<ReactBootstrap.Alert bsStyle="warning">    <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.  </ReactBootstrap.Alert>;

a require is not needed for Bootstrap itself.

Consider still doing the npm install on Bootstrap, then using Gulp to copy the CSS to a place referred to by your HTML.  Rather than trying to always link to the external bootstrap.

(Note that it’s not uncommon for people to use more refined namespaces for react-bootstrap, such as

var Modal = require(‘react-bootstrap/lib/Modal’);

then later <Modal…><Modal.Header…>…

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s