Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

react bootstrap button suddenly not working?

I’m trying to learn reactjs with bootstrap 5 so I’m trying this code but it gives an empty screen when I run npm start. this started happening after I deployed the app using github pages. yesterday it was still normal. I’m using windows 10.

this is my code

App.js

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import { Button } from "bootstrap";

const App = () => {
  return (
    <>
      <h1>Hello World</h1>
      <Button variant="primary">button</Button>
    </>
  );
};

export default App;

I’ve already added the bootstrap css file in the index.html and I already have bootstrap 5.1.3 and react-bootstrap 2.2.1 in the package.json..

any help is greatly appreciated

>Solution :

import { Button } from 'react-bootstrap';
import Button from 'react-bootstrap/Button';

Either one of these should work.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading