I have been working on boostrap react for 3 hours. I have tried to find questions and answers to my problem. bsStyle of Bootstrap React doesn't work at all, so i wonder it why? I have seen so many examples, and they just import like what i have done too.
import {Button} from 'react-bootstrap';
but i still get a simple button without any styles here my component
export class bsButton extends React.Component{
render () {
return (
<div>
<Button bsStyle="primary">primary button</Button>
</div>
);
}
}
what is wrong with my import or my component code? your help is appreciated :D
You need to make sure you have added the bootstrap CSS in the head of your page. Getting Started This can be easily forgotten when adding the library through NPM
Include
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
in public/index.html
<head>
.
.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
.
.
</head>
source: here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With