React-bootstrap: Alert Component is not rendering

Created on 11 Aug 2017  路  3Comments  路  Source: react-bootstrap/react-bootstrap

I was trying to use Alert in a project and the whole page kept crashing whenever it tries to render Alert. So I tried creating a new clean project using create-react-app and used the same example code given in the documentation in my index.js:

import React from 'react';
import ReactDOM from 'react-dom';
import {Alert} from 'react-bootstrap';

import registerServiceWorker from './registerServiceWorker';
const alertInstance = ( <Alert bsStyle="warning"> <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good. </Alert> );
ReactDOM.render(alertInstance, document.getElementById('root')); registerServiceWorker();

running that only rendered the element inside the Alert like this:

Most helpful comment

You need to include the Bootstrap CSS.

All 3 comments

You need to include the Bootstrap CSS.

Aah I presumed it was included in the react-bootsrap package

Was this page helpful?
0 / 5 - 0 ratings