Sunday

react-bootstrap-table does not have style

I use react-bootstrap-table but there is no styling.
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
import '../node_modules/react-bootstrap-table/dist/react-bootstrap-table.min.css';

.....

<BootstrapTable data={this.state.sprints} striped hover>
      <TableHeaderColumn isKey dataField='sprintNo'>Sprint no</TableHeaderColumn>
</BootstrapTable>

FIX: 
Firstly run the following npm command:
npm install bootstrap --save

Then add this css import to your .js file:
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';

No comments:

Post a Comment