728x90

🥐 오류

해결 방법은 총 2개가 있다....헤매다가 결국 해결했다...허무하다...매우......
👍 해결방법 1. <Route></Route> 감싸주기
index.tsx:19 Uncaught Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.
at invariant (index.tsx:19)
at Route (index.tsx:230)
at renderWithHooks (react-dom.development.js:14985)
at mountIndeterminateComponent (react-dom.development.js:17811)
at beginWork (react-dom.development.js:19049)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at beginWork$1 (react-dom.development.js:23964)
at performUnitOfWork (react-dom.development.js:22776)
여기 있는 해결방법 처럼 <Route></Route>로 표기했는데도 계속 오류가 난다....
해결 된다는 사람도 있으니 한번 시도 해보시길.....
👍 해결방법 2. react-router-dom라이브러리를 최신버전 또는 다운 업그레이드 한다.
이 중 저는 다운 업그레이드를 했습니다....
왜냐하면...제가 지금 클론 코딩 중인데 다운 업그레이드 해서 사용 중 이거든요...ㅎ
터미널이나 powerShell에서 다운업그레이드 하면 해결!
yarn add react-router-dom@5.3.0
npm install react-router-dom@5.3.0
728x90
'개발&etc > React' 카테고리의 다른 글
[React] express개발 code:'MODULE_NOT_FOUND' 에러 (0) | 2023.04.17 |
---|---|
[React] Node JS 버전 변경 - windows (0) | 2023.04.17 |
[React] 에러: Cannot find module 'react' (0) | 2023.03.24 |
[React] node 버전 다운 그레이드 하기 (0) | 2023.03.24 |
[React]에러: react_dom_client__WEBPACK_IMPORTED_MODULE_1__.render is not a function show in the console of localhost:3000 (0) | 2023.03.24 |