이런 에러문구가 발생한다면
<Route></Route>를 <Routes></Routes>로 묶어주어야 합니다.
또한 <Route>의 매개변수 이름또한 component → element로 변경이 되었습니다.
# 해결 방법 (2022. 01. 16 기준)
1. 아래와 같이 최신버전에 맞게 작성한다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Routes> | |
<Route exact path='/home1' element={<Home/>} /> | |
</Routes> |
2. 이전 버전을 설치해서 사용한다.
React Router | Overview
Declarative routing for React apps at any scale
reactrouter.com