React doesn't render Alert (bootstrap)

Viewed 117

I added an Alert to my React, but in the browser I see only plain text. What is the problem?

My component:

import { Alert } from 'react-bootstrap';

class App extends Component {
  render() {
    return (
      <div>
        <Alert variant='warning'>
          This is a warning alert—check it out!
        </Alert>
     </div>
    );
  }
}

export default App;

Bootstrap is already installed

package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    ...
    "bootstrap": "^4.4.1",
    "react": "^15.3.1",
    "react-bootstrap": "^0.30.3"
  }
  ...
}
1 Answers

I forgot to import stylesheet

import 'bootstrap/dist/css/bootstrap.min.css';

It was the reason

Related