‘Switch’ is not exported from ‘react-router-dom’

Seonmi Choi·2022년 1월 4일
0

Start again!!!

목록 보기
38/40
post-custom-banner

허걱 Switch가 작동이 안되어서 검색을 했다.
기존의 react-route-dom을 삭제하고 react-router-dom version 5을 설치했다.

npm uninstall react-router-dom
npm install react-router-dom@5

아래 참조 링크에서 Switch 대신 Routes를 쓰라고 하던데..
나는 작동이 안되었다.

export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)

https://flutterq.com/switch-is-not-exported-from-react-router-dom/

profile
I am not afraid of learning!
post-custom-banner

0개의 댓글