티스토리 뷰
오랜만에 React-router-dom을 새로 설치하고 이용하던 중
A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.
이라는 에러가 떳다.
<Route>는 분명 단독으로 이용가능했는데 <Routes>로 감싸야 한다는 건 처음 들어본다.
아니나 다를까 나없는 사이 6.0.0 버전이 나왔는데,,,, 상당히 불편해졌다.
Error: A <Route> is only ever to be used as the child of <Routes> element
Trying to use routing for the first time, and followed the exact instructions from Udemy: App.js: import { Route } from "react-router-dom"; import Welcome from "./Pages/Welcome";
stackoverflow.com
npm uninstall react-router-dom
npm install react-router-dom@5.0.0
요 두개로 간단히 해결했지만 오랜만의 프론트여서 그런지 두가 아프다,,
'Web > React' 카테고리의 다른 글
간단히 나를 소개하는 페이지 (0) | 2021.12.08 |
---|---|
[short] Koa-router에서 파라미터와 쿼리 읽기 (0) | 2021.11.22 |
[short] node.js에서 nodemon 이용시 에러 발생 (0) | 2021.11.22 |
React-redux 정리 (0) | 2021.11.14 |
비동기적 실행과 Promise (0) | 2021.11.09 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday