React/Router (2) 썸네일형 리스트형 React Route Dom Guard 특정 페이지에 들어갈 때 로그인이 필요하거나 인증후 들어가야하는 페이지가 있다. 그런 페이지를 Hoc를 이용해 비 로그인 상태일 때, Redirect시켜주는 간단한 예제 codesandbox에서 간단히 실행 Dependency는 react-router-dom 설치 //index.js import React from "react"; import ReactDOM from "react-dom"; import { LandingPage, Home } from "./component/Landing.page"; import { BrowserRouter, Route, Switch } from "react-router-dom"; import NotFoundPage from "./component/NotFoundPage".. React Router Dom 기초 라우팅이란? 네트워크상에서 주소를 이용, 목적지까지 경로를 체계적으로 결정하는 경로선택 과정 http://www.ktword.co.kr/word/abbr_view.php?m_temp1=539 연습은 https://codesandbox.io/ 에서 공부 기본적인 CRA로 시작 후 왼쪽 Explorer에서 Add Dependency react-router-dom 설치 componenet 폴더 생성 후, LandingPage.js파일 생성 // component/LandingPage.js import React from "react"; const LandingPage = () => Good; const Home = () => home; export { LandingPage, Home }; // index.js.. 이전 1 다음