React에서 bootstrap 사용하기

danbibibi·2021년 9월 4일
0

1. 설치

npm install react-bootstrap bootstrap

위 명령어를 이용하여 bootstrap 패키지를 설치한다.

2. 적용

import 'bootstrap/dist/css/bootstrap.min.css';

src/index.js 파일에 위와 같이 import 해준다. (안하면 적용되지 않는다!)

or

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

public/index.html 파일에 위와 같이 입력해줘도 적용된다.

profile
블로그 이전) https://danbibibi.tistory.com

0개의 댓글