我很难理解如何在React和Webpack构建中使用Bootstrap。我想使用Bootstrap的网格布局和各种功能(似乎react-bootstrap提供了所有Bootstrap的功能?),想知道设置这些的最佳方法。
例如,我尝试使用常规Bootstrap方法和react-bootstrap组件,但它们似乎都无法正常工作。另外,您建议如何使用CSS重置来规范化一切?非常感谢您的帮助。
import React from 'react';
import mui from 'material-ui';
import style from './style.scss';
import Navigation from './Navigation';
import { Grid, Row, Col } from 'react-bootstrap';
class App extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
/* normal bootstrap -- doesn't work */
<div className="container">
/* react-bootstrap which also doesn't work */
<Grid>
<Row className="show-grid">
<Col md={6} mdPush={6}><code><{'Col md={6} mdPush={6}'} /></code></Col>
<Col md={6} mdPull={6}><code><{'Col md={6} mdPull={6}'} /></code></Col>
</Row>
</Grid>
<Navigation />
</div>
);
}
}
export default App;