react-bootstrap不包含css

Sim*_*mon 4 node.js twitter-bootstrap reactjs react-bootstrap

我的jsx文件成功识别react-bootstrap元素,但它们没有样式.我的项目的node-modules文件夹包含react-bootstrap和bootstrap.为什么会这样?

var React = require('react');
var Button = require('react-bootstrap').Button;
var Jumbotron = require('react-bootstrap').Jumbotron;

var ReactComponentHi = React.createClass({displayName: 'Hi',

    render: function() {
        return (
            <div>
                <Button bsStyle='success'>
                    clickk
                </Button>
                <Jumbotron>
                    <h1>Hello, world!</h1>
                    <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
                    <p><Button bsStyle='primary'>Learn more</Button></p>
                </Jumbotron>
            </div>

        );
    }
});

module.exports = ReactComponentHi;
Run Code Online (Sandbox Code Playgroud)

结果是什么样的

Sim*_*mon 8

我将以下行添加到我的index.html并且它有效.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
Run Code Online (Sandbox Code Playgroud)