Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempted import error: 'Grid' is not exported from 'react-bootstrap'

I'm getting this error I have created a new project using npx-create-react-app and then followed the instructions written down here: https://react-bootstrap.github.io/getting-started/introduction I've installed using: npm install react-bootstrap bootstrap. Then took the CDN and copying it to my index.html

<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link
**rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>**
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

Then have imported:

import React from 'react';
import  {Grid}  from 'react-bootstrap';
import './App.css';

function App() {
  return (
    <div className="container">
        <Grid className ="purchase-card">
          <h1>Hello World</h1>
        </Grid>
    </div>
  );
}

export default App;

I've tried searching Google for a solution and variations of importing (import Button from 'react-bootstrap/Button' for example) and I cannot seem to find the issue causing this.

like image 252
NewbieAeg Avatar asked May 17 '26 13:05

NewbieAeg


1 Answers

Grid was renamed to Container as you can see here

like image 60
DefyingL Avatar answered May 19 '26 01:05

DefyingL