I want to use default Bootstrap components in my React application, so I'm using React-bootstrap NPM-package. But I stuck at the very beginning: I cannot use any default component although I'm just copying very simple exmaples from official docs. Every time I use Bootstrap-styled component, I get basic component withouts styles. For example the code below renders a <button>
without styles, not <Button bsStyle="danger">
from Bootstrap.
import React from "react";
import ReactDOM from "react-dom";
import {Provider} from 'react-redux';
import store from "./store";
import {Button} from 'react-bootstrap';
class App extends React.Component {
render() {
return (
<Provider store={store}>
<Button bsStyle="danger">Danger</Button>
</Provider>
);
}
}
ReactDOM.render(<App/>, document.getElementById('app-container'));
Why do I have such a problem? Maybe it's about Babel or Webpack: some styles are being ignored during the packaging?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…