Search code examples
htmlreactjstypescriptreact-bootstrap

react-bootstrap grid layout not displaying correctly


I am using typescript, react, and react-bootstrap. I have the following code

import React from "react"
import "./homepage/HomePage.css"
import {Col, Container, Row} from "react-bootstrap"



function HomePage() {
    return (
        <>
            <h1>Administration</h1>
            <Container>
                <Row>
                    <Col><p>Hello 1</p></Col>
                    <Col><p>Hello 2</p></Col>
                </Row>
            </Container>
        </>
    )
}

and this just shows this enter image description here


Solution

  • export default Homepage; at the end of your code

    And make sure you have imported import 'bootstrap/dist/css/bootstrap.min.css';