티스토리 뷰

오랜만에 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

요 두개로 간단히 해결했지만 오랜만의 프론트여서 그런지 두가 아프다,,

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday