5

私の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;

結果はどのように見えるか

4

2 に答える 2

11

次の行を index.html に追加したところ、機能しました。

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
于 2016-03-15T20:16:39.490 に答える