I'm making a small react app, which is setup with neutrino. How can I import/user react-bootstrap's stylesheets?
Can I use this: https://www.npmjs.com/package/neutrino-middleware-style-loader to load the styles and if so - how? I couldn't find any examples.
Asked
Active
Viewed 254 times
0
1 Answers
0
First up, you'll need to install react-bootstrap, either with Yarn or npm. Since you will also need the bootstrap CSS, I would recommend installing it also since you technically directly depend on it:
# with Yarn
yarn add bootstrap react-bootstrap
# with npm
npm install --save bootstrap react-bootstrap
Then you can import your components into your file:
import { Row, Col } from 'react-bootstrap';
Now for the stylesheet, you will only want to import this one, preferably in the default entry provided by Neutrino. According to the default project layout, this would be src/index.js
. So in your src/index.js
file:
import 'bootstrap/dist/css/bootstrap.min.css';
That should be all you need, no custom configuration to make that happen.

Eli
- 17,397
- 4
- 36
- 49