Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 클린코드다시읽기
- 갈길이 멀구나
- 함수형 코딩
- 이웅모
- 출처 : 코딩앙마
- 자바스크립트 딥다이브
- 고등애플
- 유틸리티타입은 공식문서 자주 보자
- 출처는 코딩앙마
- 로버트 C마틴
- 큰돌의 CS책
- 쏙쏙 들어오는 함수형 코딩
- 출처 : 한입크기로 잘라먹는 타입스크립트
- 쏙속 들어오는 함수형코딩
- 에릭 노먼드
- 출처 : 자바스크립트 딥다이브
- 쏙쏙들어오는함수형코딩
- https://product.kyobobook.co.kr/detail/S000001952246
- 에릭노이먼
- 흥달쌤
- 출처 : https://www.boostcourse.org/
- 에릭 노이먼
- 쏙쏙 들어오는 함수형코딩
- 생코님Redux
- 출처는 코딩애플
- 오종택개발자님
- 출처 : 코딩애플
- 리엑트를 다루는 기술
- 김영한쌤
- 나는 flux좋아...
Archives
- Today
- Total
흰둥씨의 개발장
[React] Matched leaf route at location "/" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page. 본문
끙끙거린 흔적
[React] Matched leaf route at location "/" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.
돈워리비해삐 2023. 6. 6. 12:00이렇게 입력 했는데 오류남
벨로퍼트님 책엔 Route element안써있고 다 component였는데 눈치껏 바꾸긴했었음
//App.js
function App() {
return (
<>
<Routes>
<Route component={PostListPage} path={['/@:username', '/']} exact />
<Route element={<LoginPage />} path="/login" />
<Route element={<RegisterPage />} path="/register" />
<Route element={<WritePage />} path="/write" />
<Route element={<PostPage />} path="/@:username/:postId" />
</Routes>
</>
);
Route안에 component 쓰는건 사라져서 위처럼 쓰면 안 됨
그리고 path={['/@:username','/']}이 잘 안되었다는 블로그 글발견하고 아래와 같이 수정
function App() {
return (
<>
<Routes>
<Route element={<PostListPage />} path="/" exact />
<Route element={<PostListPage />} path="/@:username" exact />
<Route element={<LoginPage />} path="/login" />
<Route element={<RegisterPage />} path="/register" />
<Route element={<WritePage />} path="/write" />
<Route element={<PostPage />} path="/@:username/:postId" />
</Routes>
</>
);
오류없이 말끔해진 콘솔창...ㅎㅎ...ㅠㅠㅠ
'끙끙거린 흔적' 카테고리의 다른 글
[React] styled-components쓸때 prop보낼때 (0) | 2023.06.06 |
---|---|
[React] styled-components 설치 오류 (설치 안될때) (0) | 2023.06.06 |
[React] toolkit의 lagacy... /redux-devtool 설치 (0) | 2023.03.17 |
[mac] vscode에서 파일수정 후 저장 안될 때 (2) | 2023.01.10 |
[mac] 맥북의 와이파이 끊김 현상 (2) | 2022.12.18 |