안녕하세요 주갬입니다.
오늘은 react-bootstrap을 이용 중에 모달창 닫기버튼 스타일이 깨지는 현상을 해결한 방법에 대해 말씀드리려고 합니다.
다른 bootstrap 요소들은 잘 나오는데 모달창 안에 있는 닫기 버튼만 스타일이 깨지는 현상이 발생했습니다.
원래는 이렇게 예쁜 닫기버튼이 나와야합니다.
구글링을 해본 결과
이 현상은 bootstrap 버전과 react-bootstrap 버전이 맞지 않을 때 발생한다고 합니다.
https://stackoverflow.com/questions/65472384/react-bootstrap-only-close-button-styling-not-working
React-Bootstrap ONLY Close Button Styling Not Working
For ALL the components I'm using with React-Bootstrap, all the styling is working EXCEPT for close buttons that are built into Modals, Alerts, etc. Examples below. Alert Component - Expected Alert
stackoverflow.com
node_modules폴더 안의 react-bootstrap 폴더 안에 있는 package.json을 보시면 react-bootstrap의 버전을 확인하실 수 있습니다.
react-bootstrap과 호환되는 bootstrap 버전은 다음과 같습니다.
- react-bootstrap@2 => bootstrap@5
- react-bootstrap@1.6.1 => bootstrap@4
- react-bootstrap@0.33.1 => bootstrap@3
저의 경우 bootstrap은 4버전을 연결해 놓았었지만 react-bootstrap은 2버전을 설치해서 오류가 났던 것이였습니다.
react-bootstrap을 이용하시는 분들은 bootstrap의 버전을 잘 확인해보시면 좋을 것 같습니다.
감사합니다.
'React' 카테고리의 다른 글
[Library] React-Dropzone 라이브러리 사용방법 (0) | 2024.11.15 |
---|---|
[React] 토큰 타임아웃 적용해서 자동 로그아웃 기능 구현하기 (0) | 2024.11.13 |
[최적화] React 프로젝트 최적화 - 1. 문제점 인식 (LightHouse) (0) | 2024.02.19 |
[React Hooks] useEffect와 useSelector 같이 쓸 때 주의해야 할 렌더링 순서 (0) | 2022.09.08 |
[Library] react-select 'label' 키 이름 안맞추고 원하는 키 이름으로 지정하는 방법 (0) | 2022.05.04 |