react-calendar 설치
https://www.npmjs.com/package/react-calendar
npm i react-calendar
SmallCalendar.js
react-calendar를 가져온다.
import Calendar from "react-calendar"
export const SmallCalendar = () => {
return (
<Calendar />
)
}
CalendarPage.js
CalendarPage안에 달력외 메뉴들을 구성할 예정이다.
import { SmallCalendar } from "../components/SmallCalendar"
export const CalendarPage = () => {
return (
<div>
<SmallCalendar/>
</div>
)
}
App.js
마지막으로 App.js에 CalendarPage를 추가해주자.
import './App.css';
import { CalendarPage } from './pages/CalendarPage';
function App() {
return (
<div className="App">
<CalendarPage />
</div>
);
}
export default App;
아래와 같이 화면에 달력이 생성되었다. 이제 내가 원하는 구조로 변경을 해보았다.

반응형
'프론트엔드 > React' 카테고리의 다른 글
| [ React ] 웹사이트 성능을 점검하는 필수 도구 Lighthouse (0) | 2025.04.24 |
|---|---|
| [ React ] Context API 란? (0) | 2025.02.18 |
| [ Lodash ] _.cloneDeep 사용법과 예시 (1) | 2024.09.25 |
| [ React ] 리액트 파일 확장자를 .js로 사용하는 것이 안 좋은가요? (2) | 2024.08.28 |
| [ React ] Lodash - sumBy, filter, includes (0) | 2024.07.15 |
댓글